ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Idris Samawi Hamid ادريس سماوي حامد" <ishamid@colostate.edu>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: Feature request for export: Interactive Notes
Date: Sat, 25 Apr 2015 06:19:14 -0600	[thread overview]
Message-ID: <op.xxnduccgfkrasx@ishamid-pc> (raw)
In-Reply-To: <553B58C3.4090208@gmx.es>

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
___________________________________________________________________________________

  reply	other threads:[~2015-04-25 12:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25  0:36 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 ادريس سماوي حامد [this message]
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=?=

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.xxnduccgfkrasx@ishamid-pc \
    --to=ishamid@colostate.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).