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

xml output #196

Open
dbvisel opened this issue Oct 3, 2022 · 2 comments
Open

xml output #196

dbvisel opened this issue Oct 3, 2022 · 2 comments

Comments

@dbvisel
Copy link

dbvisel commented Oct 3, 2022

Hi! I'm trying to make a Docker container to run this to output XML, which I can do fine using the command line, though I'm having trouble doing it in Ruby. This works to get BibTeX out of a string input:

  output = AnyStyle.parse input, format: 'bibtex'

and if I change BibText to 'csl' I get CSL out. What do I need to get a string of XML out of this? Apologies if this is a dumb question!

@inukshuk
Copy link
Owner

inukshuk commented Oct 3, 2022

You can get the XML like this:

output = AnyStyle.parse(input, format: 'wapiti').to_xml

You can pass an options hash to set the indent, margin or quote options of XML Builder.

@dbvisel
Copy link
Author

dbvisel commented Oct 3, 2022

That works perfectly! Thanks so much.

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

2 participants