Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GamebookML converter #43

Open
mrombout opened this issue Jul 30, 2023 · 1 comment
Open

GamebookML converter #43

mrombout opened this issue Jul 30, 2023 · 1 comment

Comments

@mrombout
Copy link
Owner

Implement an AsciiDoc converter to convert AsciiHero to GamebookML.

@mrombout
Copy link
Owner Author

mrombout commented Jul 30, 2023

I am trying to implement one and integrate it into the asciihero script, but somehow the getContent() doesn't want to call the correct converter (it doesn't seem to call anything at all). It calls the convert() once, but then getContent() doesn't do anything...

There don't seem to be many conditions in the code https://github.com/asciidoctor/asciidoctor/blob/main/lib/asciidoctor/abstract_block.rb#L85, so all I can think if is that the document is actually empty... That actually seems to be the case, when I log the code I get #<Asciidoctor::Document@1142 {doctype: "article", doctitle: nil, blocks: 0}>, clearly stating 0 blocks...

When I use the converter through asciidoctor directly however it behaves correctly:

#!/usr/bin/env node

const asciidoctor = require('asciidoctor')()
const GamebookConverter = require('../packages/gamebookml/converter.js')

asciidoctor.ConverterFactory.register(new GamebookConverter(), ['gamebookml'])

const content = `= Title

== Section 1

== Section 2`

console.log(asciidoctor.convert(content, {
  backend: 'gamebookml',
  standalone: true
}))

It turns out I was just passing in the wrong data...

@mrombout mrombout mentioned this issue Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant