• Home
  • Raw
  • Download

Lines Matching +full:node +full:- +full:version

1 // Copyright Joyent, Inc. and other Node contributors.
27 const find = require('unist-util-find');
28 const visit = require('unist-util-visit');
29 const markdown = require('remark-parse');
30 const remark2rehype = require('remark-rehype');
31 const raw = require('rehype-raw');
32 const htmlStringify = require('rehype-stringify');
34 const typeParser = require('./type-parser.js');
46 visit(tree, { type: 'element', tagName: 'a' }, (node) => {
47 node.properties.class = 'nav-' +
48 node.properties.href.replace('.html', '').replace(/\W+/g, '-');
54 const gtocMD = fs.readFileSync(gtocPath, 'utf8').replace(/^<!--.*?-->/gms, '');
69 const id = filename.replace(/\W+/g, '-');
77 `class="nav-${id}"`, `class="nav-${id} active"`))
82 /<!--\s*introduced_in\s*=\s*v([0-9]+)\.([0-9]+)\.[0-9]+\s*-->/);
86 console.error(`Failed to add alternative version links to ${filename}`);
99 const recursiveTextContent = (node) => argument
100 node.value || node.children.map(recursiveTextContent).join('');
108 // Handle general body-text replacements.
112 visit(tree, null, (node) => {
113 if (common.isSourceLink(node.value)) {
114 const [path] = node.value.match(/(?<=<!-- source_link=).*(?= -->)/);
115node.value = `<p><strong>Source Code:</strong> <a href="https://github.com/nodejs/node/blob/${node…
116 } else if (node.type === 'text' && node.value) {
117 const value = linkJsTypeDocs(linkManPages(node.value));
118 if (value !== node.value) {
119 node.type = 'html';
120 node.value = value;
129 const MAN_PAGE = /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm;
133 // '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>'.
146 return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` +
173 let headingIndex = -1;
176 visit(tree, null, (node, index) => {
177 if (node.type === 'heading') {
179 heading = node;
180 } else if (node.type === 'code') {
181 if (!node.lang) {
184 `line ${node.position.start.line}`);
186 const language = (node.lang || '').split(' ')[0];
188 highlight(language, node.value).value :
189 node.value;
190 node.type = 'html';
191 node.value = '<pre>' +
192 `<code class = 'language-${node.lang}'>` +
195 } else if (node.type === 'html' && common.isYAMLBlock(node.value)) {
196 node.value = parseYAML(node.value);
198 } else if (node.type === 'blockquote') {
199 const paragraph = node.children[0].type === 'paragraph' &&
200 node.children[0];
208 index - 2 === headingIndex || // General.
209 index - 3 === headingIndex; // With api_metadata block.
213 headingIndex = -1;
221 // Collapse blockquote and paragraph into a single node
222 node.type = 'paragraph';
223 node.children.shift();
224 node.children.unshift(...paragraph.children);
227 node.children.unshift({
240 node.children.push({ type: 'html', value: '</div>' });
256 added.version = meta.added.join(', ');
257 added.description = `<span>Added in: ${added.version}</span>`;
261 deprecated.version = meta.deprecated.join(', ');
263 `<span>Deprecated since: ${deprecated.version}</span>`;
267 removed.version = meta.removed.join(', ');
268 removed.description = `<span>Removed in: ${removed.version}</span>`;
276 meta.changes.sort((a, b) => versionSort(a.version, b.version));
279 '<table>\n<tr><th>Version</th><th>Changes</th></tr>\n';
289 const version = common.arrify(change.version).join(', ');
291 result += `<tr><td>${version}</td>\n` +
302 result += `<span>N-API version: ${meta.napiVersion.join(', ')}</span>\n`;
323 return +b.match(numberRe)[0] - +a.match(numberRe)[0];
332 visit(tree, null, (node) => {
333 if (node.type !== 'heading') return;
335 if (node.depth - depth > 1) {
337 `Inappropriate heading level:\n${JSON.stringify(node)}`
341 depth = node.depth;
344 node.children[0].position.start.offset,
345 node.position.end.offset).trim();
348 const hasStability = node.stability !== undefined;
349 toc += ' '.repeat((depth - 1) * 2) +
350 (hasStability ? `* <span class="stability_${node.stability}">` : '* ') +
366 node.children.push({ type: 'html', value: anchor });
378 const notAlphaNumerics = /[^a-z0-9]+/g;
380 const notAlphaStart = /^[^a-z]/;
398 `${host}/docs/latest-v${versionNum}/api/${filename}.html`;
400 const wrapInListItem = (version) => argument
401 `<li><a href="${getHref(version.num)}">${version.num}` +
402 `${version.lts ? ' <b>LTS</b>' : ''}</a></li>`;
404 function isDocInVersion(version) { argument
405 const [versionMajor, versionMinor] = version.num.split('.').map(Number);
415 <li class="version-picker">
416 <a href="#">View another version <span>&#x25bc;</span></a>
417 <ol class="version-picker">${list}</ol>
422 // eslint-disable-next-line max-len
423-2.5 15.6c.4 0 .5-.2.5-.4v-1.5c-2 .4-2.5-.5-2.7-1 0-.1-.5-.9-.8-1-.3-.2-.7-.6 0-.6.6 0 1 .6 1.2.8.…
425 …return `<li class="edit_on_github"><a href="https://github.com/nodejs/node/edit/master/doc/api/${f…