docbook-apps

  • 1.  I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-07-2019 16:22
    I am working on generating PDFs out of xqDoc http://xqdoc.org <http://xqdoc.org/> extracted from XQuery code where the descriptions can be in the format of MarkDown.




    <xqdoc:function>
    <xqdoc:comment>
    <xqdoc:description>Upload zip file to the server</xqdoc:description>
    <xqdoc:param>$files
    ## The uploaded files

    * The map's keys represent the filenames of each file uploaded
    * The map's values are themselves maps too, let's call this an "entry map"
    * The entry map contains two keys, a content-type and a body
    * The value for content-type is the Content Type of this particular file
    * The value for body is the Content Body of this particular file as a binary() item</xqdoc:param>
    </xqdoc:comment>
    <xqdoc:name>upload</xqdoc:name>
    .
    .
    .
    </xqdoc:function>




    The entry for the param of $files is in MarkDown format. Is there a way for the MarkDown to be processed when generating the PDF?


    Right now, I have it generating:

    <db:para>
    ## The uploaded files

    * The map's keys represent the filenames of each file uploaded
    * The map's values are themselves maps too, let's call this an "entry map"
    * The entry map contains two keys, a content-type and a body
    * The value for content-type is the Content Type of this particular file
    * The value for body is the Content Body of this particular file as a binary() item
    </db:para>









  • 2.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-11-2019 14:14
    On 7.2.2019 17:22, Loren Cahlander wrote:
    > The entry for the param of $files is in MarkDown format. Is there a way for the MarkDown to be processed when generating the PDF?

    Hi Loren,

    student of my wrote XSLT 2 transform that can parse Markdown and convert
    it to DocBook:

    https://github.com/MSmid/markdown2docbook

    You can add preprocessing step that would expand Markdown to DocBook
    prior normal DocBook processing.

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML and Web consulting and training services
    DocBook/DITA customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------




  • 3.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-11-2019 14:34
    Neat Jirka.
    Of note, "Md2doc supports canonical Markdown specification by John Gruber"

    regards

    On Mon, 11 Feb 2019 at 14:14, Jirka Kosek <jirka@kosek.cz> wrote:
    >
    > On 7.2.2019 17:22, Loren Cahlander wrote:
    > > The entry for the param of $files is in MarkDown format. Is there a way for the MarkDown to be processed when generating the PDF?
    >
    > Hi Loren,
    >
    > student of my wrote XSLT 2 transform that can parse Markdown and convert
    > it to DocBook:
    >
    > https://github.com/MSmid/markdown2docbook
    >
    > You can add preprocessing step that would expand Markdown to DocBook
    > prior normal DocBook processing.
    >
    > Jirka
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML and Web consulting and training services
    > DocBook/DITA customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > Bringing you XML Prague conference http://xmlprague.cz
    > ------------------------------------------------------------------
    >


    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    Docbook FAQ.



  • 4.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-11-2019 14:38
    Hello Jirka,

    Thank you for this. I will try it out.

    Loren


    > On Feb 11, 2019, at 9:14 AM, Jirka Kosek <jirka@kosek.cz> wrote:
    >
    > On 7.2.2019 17:22, Loren Cahlander wrote:
    >> The entry for the param of $files is in MarkDown format. Is there a way for the MarkDown to be processed when generating the PDF?
    >
    > Hi Loren,
    >
    > student of my wrote XSLT 2 transform that can parse Markdown and convert
    > it to DocBook:
    >
    > https://github.com/MSmid/markdown2docbook
    >
    > You can add preprocessing step that would expand Markdown to DocBook
    > prior normal DocBook processing.
    >
    > Jirka
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML and Web consulting and training services
    > DocBook/DITA customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > Bringing you XML Prague conference http://xmlprague.cz
    > ------------------------------------------------------------------
    >




  • 5.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-12-2019 15:51
    Hello Jirka,

    This works out fantastic. Thank you!

    I used the following XSLT:


    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:md2doc="http://www.markdown2docbook.com/ns/md2doc"
    xmlns:db="http://docbook.org/ns/docbook"
    exclude-result-prefixes="xs"
    version="2.0">
    <xsl:import href="src/md2doc-functions.xsl"/>
    <xsl:template match="db:para[@role='description']">
    <xsl:copy-of select="md2doc:convert(.,'','')"/>
    </xsl:template>
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>


    Loren



    > On Feb 11, 2019, at 9:37 AM, Loren Cahlander <loren.cahlander@gmail.com> wrote:
    >
    > Hello Jirka,
    >
    > Thank you for this. I will try it out.
    >
    > Loren
    >
    >
    >> On Feb 11, 2019, at 9:14 AM, Jirka Kosek <jirka@kosek.cz> wrote:
    >>
    >> On 7.2.2019 17:22, Loren Cahlander wrote:
    >>> The entry for the param of $files is in MarkDown format. Is there a way for the MarkDown to be processed when generating the PDF?
    >>
    >> Hi Loren,
    >>
    >> student of my wrote XSLT 2 transform that can parse Markdown and convert
    >> it to DocBook:
    >>
    >> https://github.com/MSmid/markdown2docbook
    >>
    >> You can add preprocessing step that would expand Markdown to DocBook
    >> prior normal DocBook processing.
    >>
    >> Jirka
    >>
    >> --
    >> ------------------------------------------------------------------
    >> Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    >> ------------------------------------------------------------------
    >> Professional XML and Web consulting and training services
    >> DocBook/DITA customization, custom XSLT/XSL-FO document processing
    >> ------------------------------------------------------------------
    >> Bringing you XML Prague conference http://xmlprague.cz
    >> ------------------------------------------------------------------
    >>
    >




  • 6.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-16-2019 16:35
    Hi

    On Mon, 2019-02-11 at 15:14 +0100, Jirka Kosek wrote:

    > student of my wrote XSLT 2 transform that can parse Markdown and
    > convert
    >
    > it to DocBook:
    >
    > https://github.com/MSmid/markdown2docbook
    >

    Thanks Jirka. This is very interesting, because in combination with
    DocBook assemblies [1] it raises the possibility of being able to pull
    together resources written in both Markdown and DocBook, and publish
    the resulting assembly through the DocBook toolchain.

    Subject matter experts and other contributors could provide and
    maintain topics or chapters in the format they prefer.

    [1]: https://tdg.docbook.org/tdg/5.1/transform.html

    --
    Simon Dew
    https://github.com/janiveer




  • 7.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-16-2019 17:21
    This is a great idea, but I must mention that we are in the process of
    updating that page about transforms in The Definitive Guide. There are
    several corrections that need to be made to the descriptions of how the
    attributes are to be used.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 2/16/2019 8:35 AM, simonjabadaw@gmail.com wrote:
    > Hi
    >
    > On Mon, 2019-02-11 at 15:14 +0100, Jirka Kosek wrote:
    >
    >> student of my wrote XSLT 2 transform that can parse Markdown and
    >> convert
    >>
    >> it to DocBook:
    >>
    >> https://github.com/MSmid/markdown2docbook
    >>
    > Thanks Jirka. This is very interesting, because in combination with
    > DocBook assemblies [1] it raises the possibility of being able to pull
    > together resources written in both Markdown and DocBook, and publish
    > the resulting assembly through the DocBook toolchain.
    >
    > Subject matter experts and other contributors could provide and
    > maintain topics or chapters in the format they prefer.
    >
    > [1]: https://tdg.docbook.org/tdg/5.1/transform.html
    >



  • 8.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-16-2019 20:20
    Hi Bob
    http://track.smtpsendemail.com/13771/c?p=a6RCivkXjardv2VIjr4uMVKQcYX6isj50N2AH5er4s9cddL8qJ9RPIxC5Dt5ZLDa9mDISN-65Qtz3VNdD8jykgMPlVKJzhhNDWm8zC2DDYW5-70ArMIsU7De0QkDcdwsV4L_Td5DphEtMc84B0EXnA== - works Ok
    http://track.smtpsendemail.com/13771/c?p=LZ6bsiKHYtXp7NABmxymwpbr_HhAIm9zV-CLOd1RS-3u34mxsmGHNXuC-1No4wNX89zLYIA2ugpUTSU_sjzet6oGk04EaKGu9RBnm3csGqxpfBz6hWxBoX12UrvjjM5X_foQBUHS2bhoT_5PqGmrVQ== - broken link
    Ron

    On 2/16/19 11:20 AM, Bob Stayton wrote:
    > This is a great idea, but I must mention that we are in the process of
    > updating that page about transforms in The Definitive Guide. There are
    > several corrections that need to be made to the descriptions of how the
    > attributes are to be used.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    > On 2/16/2019 8:35 AM, simonjabadaw@gmail.com wrote:
    >> Hi
    >>
    >> On Mon, 2019-02-11 at 15:14 +0100, Jirka Kosek wrote:
    >>
    >>> student of my wrote XSLT 2 transform that can parse Markdown and
    >>> convert
    >>>
    >>> it to DocBook:
    >>>
    >>> http://track.smtpsendemail.com/13771/c?p=SaaMz94nQm8MRhDqWRgjERRraK6MOYWSdH4oYf7KGcrQxUvMIPJN-Ss3wmtBina3I-oA5S9YGt67TNqcs_qbpa_gT-xYycTKLIBkcBiS2CidmwfCyTHal_mJ3iKWMuqyaQ1Qd2h38OuiR9lxZpOfsA==
    >>>
    >> Thanks Jirka. This is very interesting, because in combination with
    >> DocBook assemblies [1] it raises the possibility of being able to pull
    >> together resources written in both Markdown and DocBook, and publish
    >> the resulting assembly through the DocBook toolchain.
    >>
    >> Subject matter experts and other contributors could provide and
    >> maintain topics or chapters in the format they prefer.
    >>
    >> [1]:http://track.smtpsendemail.com/13771/c?p=ZJcJ7k5rFAzF7Phegn26cVplALQHqcvdm4fwK3TLm4mgWy4Hq5KxCxU52P4p6kP6CMAlIpvLzWUuKaiLUZFXnR4CbaXeMFzaXYpOaxJvh9KVdChUvu9Y_as3d9n04jCtg4yUa_mIy6X4JgNNn-Nncw==
    >>

    --
    Ron Catterall
    ron@catterall.net


  • 9.  Re: [docbook-apps] I have paragraphs that contains MarkDown. Is there a way in the XSLT to process them as markdown?

    Posted 02-16-2019 20:49
    The broken URL resolves to:

    https://tdg.docbook.org/tdg/5.1/docbook.html

    but the book is at:

    https://tdg.docbook.org/tdg/5.1/index.html

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 2/16/2019 12:19 PM, Ron Catterall wrote:
    > Hi Bob
    > http://track.smtpsendemail.com/13771/c?p=c9drGQ8sWX9lPG3k2PWXdHI-rKTms8FD6B55ahH5om8wev8w2irGCgETGhr6saRuVmASllW_9xsuIS-6yA7cUYjtk4fttyWXClhR-OH7LDVBDmOl79sMb5MtpkLJesWz7fAuYnJW5vsq1J9rG85Mfg==
    > -  works Ok
    > http://track.smtpsendemail.com/13771/c?p=1VzFpQI1Hab_XqGKLZ_RvQ2ym-7s5SPk8OKfV-5XnbUisB8G1qmSJkAnRZkYT4QJ5g5QcKQGfuaLQjTIbXg1XKuQiY1awY38rEQViaMZrJnp4ES9zaxoB-Ev-Ye_vHTz15xNemIpmov7qOacX_FMiQ==
    > -  broken link
    > Ron
    >
    > On 2/16/19 11:20 AM, Bob Stayton wrote:
    >> This is a great idea, but I must mention that we are in the process
    >> of updating that page about transforms in The Definitive Guide. There
    >> are several corrections that need to be made to the descriptions of
    >> how the attributes are to be used.
    >>
    >> Bob Stayton
    >> Sagehill Enterprises
    >> bobs@sagehill.net
    >>
    >> On 2/16/2019 8:35 AM, simonjabadaw@gmail.com wrote:
    >>> Hi
    >>>
    >>> On Mon, 2019-02-11 at 15:14 +0100, Jirka Kosek wrote:
    >>>
    >>>> student of my wrote XSLT 2 transform that can parse Markdown and
    >>>> convert
    >>>>
    >>>> it to DocBook:
    >>>>
    >>>> http://track.smtpsendemail.com/13771/c?p=HlVqvL2WMqQDkgt7SSCOXgYu2qy6q4QoQMVR_lg8SYMy0NDByo1o8FkJCXD6YYKtMc3FJ3L7b0NWtY7c15ip7c1m271Us0SVDJslfbh6j4U1Vbop-ezNv-BmtI2llvZDk9jW5l7pXwq84CSEmO1X1Q==
    >>>>
    >>>>
    >>> Thanks Jirka. This is very interesting, because in combination with
    >>> DocBook assemblies [1] it raises the possibility of being able to pull
    >>> together resources written in both Markdown and DocBook, and publish
    >>> the resulting assembly through the DocBook toolchain.
    >>>
    >>> Subject matter experts and other contributors could provide and
    >>> maintain topics or chapters in the format they prefer.
    >>>
    >>> [1]:http://track.smtpsendemail.com/13771/c?p=igec-BSFVwZ7Qs5jIwDbGX9DcVNRN0pzkyMlZB6HGmX-yZXbStraiqLX2eZy7E2qn-IP6-CFqdPJST1i_v2lnH0dTvjp5G5U_DQlDxExrobQL9kn4RdDrS7dj69iDcimQHpQnJH1v_Xr67wTMyH0iw==
    >>>
    >>>
    >