video.js

Зеркало из https://github.com/videojs/video.js
Форк
0
/
fix-api-docs.js 
43 строки · 2.2 Кб
1
const replace = require('replace');
2
const path = require('path');
3
const apiPath = path.join(__dirname, '..', 'docs', 'api');
4

5
const replacements = [
6
  {find: /\/docs\/guides\/(.+)\.md/g, replace: 'tutorial-$1.html'},
7
  {find: /tutorial-tech.html/g, replace: 'tutorial-tech_.html'},
8
  {find: /\/docs\/guides\//g, replace: '#'},
9
  {find: /(\<h[1-6] id="(?:.*)?)video-js(.*)?"\>/g, replace: '$1videojs$2">'},
10
  {find: /(\<h[1-6] id="(?:.*)?)don-t(.*)?"\>/g, replace: '$1dont$2">'},
11
  {find: /(\<h[1-6] id="(?:.*)?)node-js(.*)?"\>/g, replace: '$1nodejs$2">'},
12
  {find: /(\<h[1-6] id="(?:.*)?)vtt-js(.*)?"\>/g, replace: '$1vttjs$2">'},
13
  {find: /(\<h[1-6] id=")-(.*)("\>)/g, replace: '$1$2$3'},
14
  {find: /(\<h[1-6] id=")(.*)-("\>)/g, replace: '$1$2$3'},
15
  {find: /(\<h[1-6] id=".*)-docs-guides-.*-md("\>)/g, replace: '$1$2'},
16
  // replace all children with children-1
17
  {find: /\<h3 id="children"\>/g, replace: '<h3 id="children-1">'},
18
  // remove the -1 from the first item
19
  {find: /\<h3 id="children-1"\>/, replace: '<h3 id="children">'},
20
  {find: '<h4 id="nativecontrolsfortouch">', replace: '<h4 id="nativecontrolsfortouch-1">'},
21
  {find: '<h3 id="videojs-(audio|video)track">', replace: '<h3 id="videojs$1track">'},
22
  {find: '<h3 id="text-tracks">', replace: '<h3 id="text-tracks-1">'},
23
  {find: '<h2 id="q-how-can-i-hide-the-links-to-my-video-subtitles-audio-tracks">',
24
    replace: '<h2 id="q-how-can-i-hide-the-links-to-my-videosubtitlesaudiotracks">'},
25
  {find: '<h3 id="dispose-http-docs-videojs-com-player-html-dispose">',
26
    replace: '<h3 id="dispose">'},
27
  {find: '<h4 id="effect-on-player-width-and-player-height">',
28
    replace: '<h4 id="effect-on-playerwidth-and-playerheight">'},
29
  {find: '<h4 id="i-want-to-have-a-single-source-and-dont-care-about-live-adaptive-streaming">',
30
    replace: '<h4 id="i-want-to-have-a-single-source-and-dont-care-about-liveadaptive-streaming">'},
31
  {find: '<h2 id="api-docs-api">', replace: '<h2 id="api-docs">'},
32
  {find: '<h2 id="guides-docs-guides">', replace: '<h2 id="guides">'}
33
];
34

35
replacements.forEach(function(obj) {
36
  replace({
37
    regex: obj.find,
38
    replacement: obj.replace,
39
    paths: [apiPath],
40
    recursive: true,
41
    silent: true
42
  });
43
});
44

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.