* Feature request for export: Interactive Notes @ 2015-04-25 0:36 Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 0:44 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 9:05 ` Pablo Rodriguez 0 siblings, 2 replies; 9+ messages in thread From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 0:36 UTC (permalink / raw) To: ntg-context 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 0:36 Feature request for export: Interactive Notes Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 0:44 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 9:05 ` Pablo Rodriguez 1 sibling, 0 replies; 9+ messages in thread From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 0:44 UTC (permalink / raw) To: ntg-context [-- Attachment #1: Type: text/plain, Size: 2548 bytes --] + attachment On Fri, 24 Apr 2015 18:36:12 -0600, Idris Samawi Hamid ادريس سماوي حامد <ishamid@colostate.edu> 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. 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 #2: test-md-footnote.html --] [-- Type: text/html, Size: 32545 bytes --] [-- Attachment #3: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 0:36 Feature request for export: Interactive Notes Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 0:44 ` Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 9:05 ` Pablo Rodriguez 2015-04-25 12:19 ` Idris Samawi Hamid ادريس سماوي حامد 1 sibling, 1 reply; 9+ messages in thread From: Pablo Rodriguez @ 2015-04-25 9:05 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 9:05 ` Pablo Rodriguez @ 2015-04-25 12:19 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:19 ` Pablo Rodriguez 0 siblings, 1 reply; 9+ messages in thread From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 12:19 UTC (permalink / raw) To: mailing list for ConTeXt users Hi Pablo, On Sat, 25 Apr 2015 03:05:07 -0600, Pablo Rodriguez <oinos@gmx.es> wrote: > 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 12:19 ` Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 19:19 ` Pablo Rodriguez 2015-04-25 19:34 ` Idris Samawi Hamid ادريس سماوي حامد ` (3 more replies) 0 siblings, 4 replies; 9+ messages in thread From: Pablo Rodriguez @ 2015-04-25 19:19 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 19:19 ` Pablo Rodriguez @ 2015-04-25 19:34 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:35 ` Idris Samawi Hamid ادريس سماوي حامد ` (2 subsequent siblings) 3 siblings, 0 replies; 9+ messages in thread From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 19:34 UTC (permalink / raw) To: mailing list for ConTeXt users Hi Pablo, On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez <oinos@gmx.es> wrote: > > 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 19:19 ` Pablo Rodriguez 2015-04-25 19:34 ` Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 19:35 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:37 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:42 ` =?iso-8859-6-i?B?SWRyaXMgU2FtYXdpIEhhbWlkIMfP0erTINPlx+jqIM3H5c8=?= 3 siblings, 0 replies; 9+ messages in thread From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 19:35 UTC (permalink / raw) To: mailing list for ConTeXt users Hi Pablo, On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez <oinos@gmx.es> wrote: > > 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 19:19 ` Pablo Rodriguez 2015-04-25 19:34 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:35 ` Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 19:37 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:42 ` =?iso-8859-6-i?B?SWRyaXMgU2FtYXdpIEhhbWlkIMfP0erTINPlx+jqIM3H5c8=?= 3 siblings, 0 replies; 9+ messages in thread From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 19:37 UTC (permalink / raw) To: mailing list for ConTeXt users On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez <oinos@gmx.es> wrote: >> [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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Feature request for export: Interactive Notes 2015-04-25 19:19 ` Pablo Rodriguez ` (2 preceding siblings ...) 2015-04-25 19:37 ` Idris Samawi Hamid ادريس سماوي حامد @ 2015-04-25 19:42 ` =?iso-8859-6-i?B?SWRyaXMgU2FtYXdpIEhhbWlkIMfP0erTINPlx+jqIM3H5c8=?= 3 siblings, 0 replies; 9+ messages in thread From: =?iso-8859-6-i?B?SWRyaXMgU2FtYXdpIEhhbWlkIMfP0erTINPlx+jqIM3H5c8=?= @ 2015-04-25 19:42 UTC (permalink / raw) To: mailing list for ConTeXt users On Sat, 25 Apr 2015 13:19:47 -0600, Pablo Rodriguez <oinos@gmx.es> wrote: >> [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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-04-25 19:42 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-04-25 0:36 Feature request for export: Interactive Notes Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 0:44 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 9:05 ` Pablo Rodriguez 2015-04-25 12:19 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:19 ` Pablo Rodriguez 2015-04-25 19:34 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:35 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:37 ` Idris Samawi Hamid ادريس سماوي حامد 2015-04-25 19:42 ` =?iso-8859-6-i?B?SWRyaXMgU2FtYXdpIEhhbWlkIMfP0erTINPlx+jqIM3H5c8=?=
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).