Skip to content

Commit

Permalink
Merge pull request #56 from jygastaud/52-asciidoc-support
Browse files Browse the repository at this point in the history
Fix update command
  • Loading branch information
phodal authored Aug 23, 2024
2 parents 44eb858 + 599fd33 commit 17a3cda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function generateToc (options?: {output: boolean}) {
function generateAsciidocToc (options?: {output: boolean}) {
let path = Config.getSavePath()
let graphGenerate = new GenerateBuilder(path)
let header = '= ' + getI18n().tocHeader + '\n'
let header = '.' + getI18n().tocHeader + '\n'
let results = graphGenerate
.setStart(header)
.setEnd('')
Expand Down
2 changes: 1 addition & 1 deletion src/lib/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function updateNameByTitle (): void {
let fileName = file.relativePath
let fileExt = Config.getDocExtension()
let startChar = fileExt === 'adoc' ? '=' : '#'
let fileData = fs.readFileSync(savePath + fileName, 'let fileExt = Config.getDocExtension()utf8')
let fileData = fs.readFileSync(savePath + fileName, 'utf8')
let firstLine = fileData.split('\n')[0]
let indexRegexValue = new RegExp(String.raw`${startChar}\s(\d+)\.\s`, '')
let title = firstLine.replace(indexRegexValue, '')
Expand Down

0 comments on commit 17a3cda

Please sign in to comment.