Feature request for export: Interactive Notes
Dear gang, I've spent a considerable amount of time over the past month trying to master the art of xhtml output. We are close to being able to use ConTeXt as a replacement for markdown in, e.g., WordPress. Indeed, I plan to present the results of this experiment (porting an entire academic article to xhtml and WP) in a future article for one of the TeX journals... There is at least one crucial feature that's still needed. Perhaps it is already supported: If so, it would be much appreciated if someone kindly explained how to do it. In a web post (or epub), one wants to be able to interact back and forth with notes. Here is how markdown (extra) does it: ========Input======== That's some text with a footnote.[^1] [^1]: And that's the footnote. That's the second paragraph of the note. More main text ========Output======== <p>That's some text with a footnote.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p> <p>More main text</p> <div class="footnotes"> <hr /> <ol> <li id="fn:1"> <p>And that's the footnote.</p> <p>That's the second paragraph of the note. <a href="#fnref:1" rev="footnote">↩</a></p> </li> </ol> </div> ===================== The resulting html file is attached. '↩' corresponds to U+21A9 (↩). See also https://michelf.ca/projects/php-markdown/extra/#footnotes Now we can of course already export xhtml footnotes from ConTeXt but there will be no interactive links. In the current project, there are 77 footnotes; I had to add the links manually to get the output to do what we wanted. [Also note that it makes much more sense to export the footnotes as endnotes, particularly for long blog posts.] Is there already a way to get done automatically? In any case: This feature is a must-do in my humble opinion. Aside from a few other export bugs, this is one of the few features still needed so that ConTeXt can completely replace markdown for (advanced) web posts. Thanks is advance and Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80523
+ attachment
On Fri, 24 Apr 2015 18:36:12 -0600, Idris Samawi Hamid ادريس سماوي حامد
Dear gang,
I've spent a considerable amount of time over the past month trying to master the art of xhtml output. We are close to being able to use ConTeXt as a replacement for markdown in, e.g., WordPress. Indeed, I plan to present the results of this experiment (porting an entire academic article to xhtml and WP) in a future article for one of the TeX journals...
There is at least one crucial feature that's still needed. Perhaps it is already supported: If so, it would be much appreciated if someone kindly explained how to do it.
In a web post (or epub), one wants to be able to interact back and forth with notes. Here is how markdown (extra) does it:
========Input======== That's some text with a footnote.[^1]
[^1]: And that's the footnote.
That's the second paragraph of the note.
More main text ========Output======== <p>That's some text with a footnote.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p> <p>More main text</p>
<div class="footnotes"> <hr /> <ol> <li id="fn:1"> <p>And that's the footnote.</p> <p>That's the second paragraph of the note. <a href="#fnref:1" rev="footnote">↩</a></p> </li> </ol> </div> =====================
The resulting html file is attached. '↩' corresponds to U+21A9 (↩). See also
https://michelf.ca/projects/php-markdown/extra/#footnotes
Now we can of course already export xhtml footnotes from ConTeXt but there will be no interactive links. In the current project, there are 77 footnotes; I had to add the links manually to get the output to do what we wanted.
[Also note that it makes much more sense to export the footnotes as endnotes, particularly for long blog posts.]
Is there already a way to get done automatically?
In any case: This feature is a must-do in my humble opinion. Aside from a few other export bugs, this is one of the few features still needed so that ConTeXt can completely replace markdown for (advanced) web posts. Thanks is advance and
Best wishes Idris
-- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80523
On 04/25/2015 02:36 AM, Idris Samawi Hamid ادريس سماوي حامد wrote:
Dear gang,
I've spent a considerable amount of time over the past month trying to master the art of xhtml output. We are close to being able to use ConTeXt as a replacement for markdown in, e.g., WordPress.
Hi Idris, Markdown or pandoc? Markdown is the markup format, pandoc is the tool. Replacing pandoc with ConTeXt to generate XHTML or ePub files has a downside. As far as I know, ConTeXt is much slower for this task. With a sample from pandoc (http://pandoc.org/epub.html#a-real-book), it takes between 5 and 3 seconds on my computer (depending whether pandoc is loaded in memory or not). With pandoc you have also more formats to write to.
Indeed, I plan topresent the results of this experiment (porting an entire academic article to xhtml and WP) in a future article for one of the TeX journals...
I’m really interested in reading it. Also because I’m trying to use ConTeXt to generate high-quality PDF documents from XHTML files generated by pandoc ;-).
Now we can of course already export xhtml footnotes from ConTeXt but there will be no interactive links. In the current project, there are 77 footnotes; I had to add the links manually to get the output to do what we wanted.
I’m afraid that missing links for footnotes is a bug,
[Also note that it makes much more sense to export the footnotes as endnotes, particularly for long blog posts.]
I think that footnotes are related to pages. You can only have proper footnotes in a page. Just in case it might help, Pablo -- http://www.ousia.tk
Hi Pablo,
On Sat, 25 Apr 2015 03:05:07 -0600, Pablo Rodriguez
On 04/25/2015 02:36 AM, Idris Samawi Hamid ادريس سماوي حامد wrote:
Dear gang,
I've spent a considerable amount of time over the past month trying to master the art of xhtml output. We are close to being able to use ConTeXt as a replacement for markdown in, e.g., WordPress.
Hi Idris,
Markdown or pandoc? Markdown is the markup format, pandoc is the tool.
In this case we're talking about markdown qua source. In the WordPress case, pandoc of course is not needed: WP can either use md directly or (as I prefer) an editor such as MarkdownPad~2 will export the html for you, which you can then paste to WP.
Replacing pandoc with ConTeXt to generate XHTML or ePub files has a downside.
As far as I know, ConTeXt is much slower for this task.
Absolutely, by far. But see below.
With a sample from pandoc (http://pandoc.org/epub.html#a-real-book), it takes between 5 and 3 seconds on my computer (depending whether pandoc is loaded in memory or not).
Sure, and as you know I've done an entire small book using pandoc (docx->md; then md->epub; md->context->pdf)
With pandoc you have also more formats to write to.
Yes, but the goal here is much narrower: to use ConTeXt as source. Perhaps if pandoc supported ConTeXt input I might have gone that route, but I don't see that happening anytime soon... For simple tasks the markdown/pandoc route is excellent. But as the typesetting needs become more advanced (e.g., bibliographies), markdown as source makes less and less sense. And pandoc export to epub has limitations, as you and I have discussed before. Yes, the ConTeXt route is slower, and the learning curve has been considerably longer than I anticipated. But the resulting workflow is *much* more flexible for serious academic typesetting and export tasks.
Indeed, I plan topresent the results of this experiment (porting an entire academic article to xhtml and WP) in a future article for one of the TeX journals...
I’m really interested in reading it. Also because I’m trying to use ConTeXt to generate high-quality PDF documents from XHTML files generated by pandoc ;-).
Ah, I'll be interested in seeing that workflow as well ;-)
Now we can of course already export xhtml footnotes from ConTeXt but there will be no interactive links. In the current project, there are 77 footnotes; I had to add the links manually to get the output to do what we wanted.
I’m afraid that missing links for footnotes is a bug,
Hmm, what do you mean exactly?
[Also note that it makes much more sense to export the footnotes as endnotes, particularly for long blog posts.]
I think that footnotes are related to pages. You can only have proper footnotes in a page.
This is why I said that it makes much more sense to export the footnotes as endnotes. At the end of, e.g., a blog post you'll have a section for footnotes/endnotes. In the context source I had to make a derivative version and use something like \startsubsubject[title=Endnotes] \placefootnotes \stopsubsubject [Aside: I wonder if there is a way in ConTeXt to setup \placefootnotes etc. in a mode so that it gets invoked only in the export. Will explore this for the article.] Some crude regular expressions helped me to edit ConTeXt's *div.xhtml output; with scripting one should be able to do it all automatically. But my scripting skill set is limited-to-nonexistent so the part of the task that couldn't fit easily into a regex sub I had to do manually. Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
On 04/25/2015 02:19 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
[...] Indeed, I plan to present the results of this experiment (porting an entire academic article to xhtml and WP) in a future article for one of the TeX journals...
I’m really interested in reading it. Also because I’m trying to use ConTeXt to generate high-quality PDF documents from XHTML files generated by pandoc ;-).
Ah, I'll be interested in seeing that workflow as well ;-)
Hi Idris, I’m working on an article on this topic. But without bibligraphies, I have never used myself in ConTeXt or in pandoc :-(.
Now we can of course already export xhtml footnotes from ConTeXt but there will be no interactive links. In the current project, there are 77 footnotes; I had to add the links manually to get the output to do what we wanted.
I’m afraid that missing links for footnotes is a bug,
Hmm, what do you mean exactly?
If footnotes in ePub (or XHTML) have no links, how is the user supposed to handle them? I must be missing something, because I think footnotes are hardly accesible in XHTML without links.
This is why I said that it makes much more sense to export the footnotes as endnotes. At the end of, e.g., a blog post you'll have a section for footnotes/endnotes. In the context source I had to make a derivative version and use something like
\startsubsubject[title=Endnotes] \placefootnotes \stopsubsubject
[Aside: I wonder if there is a way in ConTeXt to setup \placefootnotes etc. in a mode so that it gets invoked only in the export. Will explore this for the article.]
How about the system mode: \doifmode{*export}{\placefootnotes}? I discovered this (http://wiki.contextgarden.net/Modes#System_modes) after the reply from Hans to my own question. Best, Pablo -- http://www.ousia.tk
Hi Pablo,
On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez
Hmm, what do you mean exactly?
If footnotes in ePub (or XHTML) have no links, how is the user supposed to handle them?
I must be missing something, because I think footnotes are hardly accesible in XHTML without links.
I think we're both saying the same thing in different ways: I'm calling it a missing/needed feature (unless I'm missing something already there); you're calling it a bug. Either way, it's something emphatically needed for this workflow to be efficient. Best wishes Idris PS. You can see the outcome of the workflow here: http://www.walayah.org/blog/shaykh-aḥmad-ibn-zayniddin-al-aḥsaʾi-part-1-life-travels-character-and-charisma If you examine the page source, you'll see an xhtml div container; that comes from context. The footnote links I added manually. -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
Hi Pablo,
On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez
Hmm, what do you mean exactly?
If footnotes in ePub (or XHTML) have no links, how is the user supposed to handle them?
I must be missing something, because I think footnotes are hardly accesible in XHTML without links.
I think we're both saying the same thing in different ways: I'm calling it a missing/needed feature (unless I'm missing something already there); you're calling it a bug. Either way, it's something emphatically needed for this workflow to be efficient. Best wishes Idris PS. You can see the outcome of the workflow here: http://www.walayah.org/blog/shaykh-aḥmad-ibn-zayniddin-al-aḥsaʾi-part-1-life-travels-character-and-charisma If you examine the page source, you'll see an xhtml div container; that comes from context. The footnote links I added manually. -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez
[Aside: I wonder if there is a way in ConTeXt to setup \placefootnotes etc. in a mode so that it gets invoked only in the export. Will explore this for the article.]
How about the system mode: \doifmode{*export}{\placefootnotes}?
I discovered this (http://wiki.contextgarden.net/Modes#System_modes) after the reply from Hans to my own question.
Ok, thanks Pablo; will explore this as well, especially after I start writing the journal article. Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez
[Aside: I wonder if there is a way in ConTeXt to setup \placefootnotes etc. in a mode so that it gets invoked only in the export. Will explore this for the article.]
How about the system mode: \doifmode{*export}{\placefootnotes}?
I discovered this (http://wiki.contextgarden.net/Modes#System_modes) after the reply from Hans to my own question.
Ok, thanks Pablo; will explore this as well, especially after I start writing the journal article. Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
participants (5)
-
Idris Samawi Hamid ادريس سماوي ح امد
-
Idris Samawi Hamid ادريس سماوي ح امد
-
Idris Samawi Hamid ادريس سماوي حامد
-
Idris Samawi Hamid ����� ����� ����
-
Pablo Rodriguez