File tree Expand file tree Collapse file tree 5 files changed +32
-4
lines changed Expand file tree Collapse file tree 5 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ docs/_build
22node_modules
33cache
44.vitepress /dist
5+ docs_md
Original file line number Diff line number Diff line change @@ -25,10 +25,6 @@ export default async () => {
2525 { icon : 'github' , link : 'https://github.com/nvim-orgmode/orgmode' }
2626 ]
2727 } ,
28- ignoreDeadLinks : true ,
29- transformHtml ( code , id , ctx ) {
30- console . log ( 'id' , id )
31- } ,
3228 } )
3329
3430}
Original file line number Diff line number Diff line change 1+ import fs from 'fs'
2+ import path from 'path'
3+ import { execSync } from 'child_process'
4+ import { dirname } from 'node:path' ;
5+ import { fileURLToPath } from 'node:url' ;
6+
7+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
8+
9+ const generateMd = async ( ) => {
10+ const files = fs . readdirSync ( path . resolve ( __dirname , '../docs' ) )
11+ fs . mkdirSync ( path . resolve ( __dirname , '../docs_md' ) )
12+ for await ( const file of files ) {
13+ execSync ( `pandoc --lua-filter=${ __dirname } /pandoc_fix_links.lua -s ${ __dirname } /../docs/${ file } -o ${ __dirname } /../docs_md/${ path . parse ( file ) . name } .md -t gfm` )
14+ }
15+ }
16+
17+ generateMd ( ) . then ( ( ) => {
18+ process . exit ( 0 )
19+ } ) . catch ( ( err ) => {
20+ console . error ( err )
21+ process . exit ( 1 )
22+ } )
Original file line number Diff line number Diff line change 1+ function Link (el )
2+ local target = el .target
3+ if target :sub (1 , 2 ) == ' ./' then
4+ target = target :gsub (' ^(%./%w+)(%.org)(.*)$' , ' %1.md%3' )
5+ target = target :gsub (' ::' , ' ' )
6+ end
7+ el .target = target
8+ return el
9+ end
You can’t perform that action at this time.
0 commit comments