On Sun, 06 May 2012 14:29:58 -0600, Aditya Mahajan
On Sun, 6 May 2012, Idris Samawi Hamid ادريس سماوي حامد wrote:
I have a paper done in ConTeXt that I would like to put online. I _could_ manually convert my input to markdown, but I was wondering if the xml/xhtml export options could be used to accomplish the same thing.
Why do you want to introduce markdown as an intermediate format? The exported XML can be used directly.
I opened the xml code in my browser, and there is zero formatting whatsoever. So it seems that something else is needed to get the formatting right for the web. Hence my thought of converting to markdown.
Although I have done a lot of doc-to-context conversions via pandoc (doc->odt->markdown->context) I have never needed to go the other way till now.
Pandoc has an latex reader, and it should not be too hard to write a context reader (although you end up loosing a lot of information about the structure, so it is not too useful).
Yeah, I noticed the latex input reader, and there was some discussion way back about doing a context reader as well, but I did not keep up with that discussion.
I had tried a proof of concept context to markdown writer by directly outputting the markdown in the pdf and converting it to text using pdftotext. I found that to be a more easily configurable way to export ConTeXt to markdown than tweaking a parser.
that sounds interesting, although the Arabic text that Adobe exports from a context pdf is generally not good (something I want to look at one day).
What would you guys suggest? Is there a way to convert context's xml/xhtml to markdown? (Note that I know little about html, css etc).
In one project, I used the ConTeXt export XML+custom CSS to display the results in a web-browser. For the most part it worked fine, although in some cases I had to tweak the lua code that generated the XML (mainly in order to control the conversion of images; Hans did add some support for image conversion after that).
Ok, so I have the .export and .css files. How do I turn them into something a browser can display correctly? How can I turn it into something I can copy and paste into, say, WordPress?
If you want more control, the best thing to do is to process the XML using xmlproc or something similar.
One thing (bug?) I have noticed: bibliographic info gets lost in the backend export, so I end up with a lot of Xxxxxxxx (0000) etc in the output. Isn't there a tmp file the export backend can access to pick up this info?
Best create a minimal example to show the bug. It should be relatively simple to fix.
Turns out it was my fault. I saved a project as <project>-xml.tex but did not save the corresponding bbl file to the exact same name <project>-xml.bbl. So the bbl file was not read during compile. OTOH, the list of bibliography entries all run together in the xml output, with no tagging of each entry as a separate line, etc. Thanks Aditya for your help and advice, and Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523