Skip to content

Instantly share code, notes, and snippets.

Report from 8/9/2021, 5:57:42 PM

All unhandled elements

  • tr (260)
  • td[style="text-align: center;"] (147)
  • th (55)
  • table.standard-table (53)
  • td[rowSpan="2"] (39)
  • td (34)
  • td[colSpan="2"] (10)
  • kbd (8)
let last = 0; // last millisecond recorded
let lineno = 0; // current output line number
const iterations = 15;
let count = 0;
function timeout() {
logline(new Date().getMilliseconds());
count = count + 1;
if (count < iterations) {
setTimeout(timeout, 0);

Specifying MDN to Markdown conversion

This document describes how we'll convert MDN's HTML content into Markdown. It's focused on the JavaScript docs (https://developer.mozilla.org/en-US/docs/Web/JavaScript) because converting that is our immediate goal: however, it should be useful for converting more doc sets in the future.

It tries to take a systematic approach to conversion by listing:

  • every HTML element
  • every HTML attribute
  • every value for the class attribute encountered

There are three pieces we need to think about in migrating MDN to Markdown:

  1. how we should represent MDN content using Markdown
  2. how we should convert MDN's HTML content into that Markdown representation
  3. updating/adapting Yari tooling to work with Markdown as the authoring format

Representing MDN in Markdown

For this we need to think of the places in MDN where we're currently using features of HTML that can't be represented in our chosen Markdown (GFM, very likely). For each of these features, we can choose between about four options:

This file is just a list of the textContent of all first paragraphs of pages in the JS docs that **do not** use `summary` or `seoSummary` to demarcate a custom summary.
The point is to give us an idea of the general length of summaries that are being generated for the JS docs.
*********************
Why a re-introduction? Because JavaScript is notorious for being misunderstood. It is often derided as being a toy, but beneath its layer of deceptive simplicity, powerful language features await. JavaScript is now used by an incredible number of high-profile applications, showing that deeper knowledge of this technology is an important skill for any web or mobile developer.
*********************
JavaScript® (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions, and is best known as the scripting language for Web pages, but it's used in many non-browser environments as well. It is a prototype-based, multi-paradigm scripting language that is dynamic, and suppo
"use strict";
const fs = require("fs")
const path = require("path")
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
/* get all ".html" files under the given directory into an array */
function getAllFiles(dirPath, files) {

Changelog

This is version 1.2.2 of the Matrix specification.

Versions for the Matrix specification follow a three-part format like major.minor.patch.

  • major version increments are reserved for very significant changes.
  • minor version increments may signal additions, deprecations, or breaking changes.
  • patch versions are for clarifications to the specification and don't affect implementations.

In matrix-doc:

/                                      <- overview
    /client-server                     <- client-server
    /server-server                     <- etc
    /rooms
        /v1                            <- room version 1
        /v2                            <- etc

matrix-doc could also contain:

125:1-125:32 error data.examples not expected in this order javascript-language-feature/ingredient-out-of-order/data.examples html-require-ingredient-order
229:1-229:44 error data.specifications not expected in this order javascript-language-feature/ingredient-out-of-order/data.specifications html-require-ingredient-order
244:1-244:58 error data.browser_compatibility not expected in this order javascript-language-feature/ingredient-out-of-order/data.browser_compatibility html-require-ingredient-order
250:1-250:54 error prose.* (#Cross-browser_notes) not expected in this order javascript-language-feature/ingredient-out-of-order/prose.* html-require-ingredient-order
// get all the ingredients from the recipe that were present in the page, plus "prose.*"
const filteredRecipeIngredients = file.data.recipe.body.filter(
(ingredient) =>
pageIngredientNames.includes(ingredient) || ingredient === "prose.*"
);
// get the index of the "prose.*" ingredient in the recipe
const indexOfProseStar = filteredRecipeIngredients.indexOf("prose.*");
if (indexOfProseStar !== -1) {
// get the ingredients before and after prose.* in the recipe