Blog post: Scientific refereeing using Bike Outliner

Hi there, I have recently published a blog post on how I use Bike as a scientist to streamline my participation the peer review process: Scientific refereeing using Bike Outliner.

Potentially of interest is that I have created an XSLT stylesheet to more reliably convert Bike outlines to idiomatic HTML, which can then be processed by Pandoc into reasonable Markdown. This is important because of the plain text and Markdown format requirements of most scientific conference peer review systems. You can see my scripts here: ~jonsterling/bike-convertors - Scripts to convert Bike outlines to standard HTML and Markdown. - sourcehut git

4 Likes

Thanks for sharing, this looks really interesting. I haven’t had a chance to really look into it and run the scripts, but will try it out this weekend.

1 Like

Excellent ! Many thanks for doing this, and for sharing it with us.

Out of interest – you are are choosing to skip | xhtml:s in your main match ?

(if added, it seems to work, and leads to markup like ~~someString~~ in pandoc markdown output, for example, but perhaps there are other considerations ?)

1 Like

@complexpoint Thanks! (I forgot about that xhtml:s thing, but we can add it.)

1 Like

Fantastic! Thanks a lot Jon for sharing your detailed Bike Workflow!
I will try to go through the steps mentioned in your website.

1 Like

:+1:

PS this is excellent too: Absolute vs. relative hierarchy in document markup languages

(Not to mention that whole OCaml build system for composing and serialising labelled propositional subtrees)

I salute you.

3 Likes

PPS Bike’s task type is probably outside the scope of your immediate application there, but I notice that from markdown like:

- [ ] an unchecked item
- [x] a checked item

pandoc writes out html in the pattern:

<li><label><input type="checkbox" />an unchecked item</label></li>
<li><label><input type="checkbox" checked="" />a checked item</label></li>

so I guess that, for other applications, it might prove feasible to generalise your XSL a little to allow for a differentiation between task and ordered.


For some purposes … not sure that pandoc reads that html pattern back …

Yeah, I was a little worried that Pandoc would not read it back when converting to Markdown…

1 Like

P.S. @complexpoint Thanks so much for the kind words! I have thought a lot about these topics and it is really exciting to see that others are interested in them too, and seeing vibrant communities around tools like Bike (and hopefully, in the future, Forester) is a breath of fresh air. Always happy to chat about such things :slight_smile:

1 Like

I look forward very much to chatting – perhaps in a parallel channel ? – about questions posed by this latest crisis in the life of text (Forester is the most encouraging development that I have seen).

I don’t know if you have seen Lines of Thought: Branching Diagrams and the Medieval Mind, Even-Ezra, 2021 but it seems that the print revolution lost something that was just getting established in the margins of late scholastic manuscripts.


On XLST from the Bike task to the Pandoc AST via a canonical HTML:

It turns out that the Pandoc AST derived from markdown - [ ] and - [x] prefixes just represents them as Unicode prefixes to plain strings, i.e.

  • &#9744; Ballot Box
  • &#9746; Ballot Box With X

respectively, and experimentally, it appears that HTML of the corresponding pattern:

<li>&#9744; an unchecked item</li>
<li>&#9746; a checked item</li>

is indeed read back to the same AST pattern, and written out from there back to markdown - [ ] and - [x]


(Not sure how the pandoc html reader and writer got out of sync on this – I’ll see if there’s a note on their github repository yet).


UPDATE

HTML reader and HTML writer out of sync on tasks · Issue #9047 · jgm/pandoc

1 Like

Thanks for sharing this very interesting-looking book — I will certainly add it to my reading list. As for a venue to chat further, feel free to email me to discuss more — for private communications, I can be reached at js2878 [at] cam.ac.uk, and for public communications, you can use ~jonsterling/public-inbox [at] lists.sr.ht.

1 Like

All the excitement here motivated me to try this out early, before I take the day off for a boat ride.

It’s really nice! The examples and scripts were easy to get going. I always hoped using html as a file format would enable more projects like this.

Your site is really eye opening too. All those links and references, felt like a hypertext fantasy from the old days, except it was real. I haven’t yet looked into Forester, but that’s on my list now.

It’s maybe a bit superficial, but one thing I got from reading over your site is that Bike’s links are way too bright. I think after I work on outline paths in next release I need to work on styling. Give everyone else a chance to define how outlines look, then I’ll steel my favorite ideas as new defaults :).

3 Likes

I haven’t really thought about links very much… but thinking now… is it kinda backward how links are normally highlighted brighter than the surrounding text? The point of a link (at least one embedded in content, as opposed to navigation) is to expand upon the surrounding text.

When they are bright they instead mostly distract attention away from the surrounding text. It becomes harder to read, and as a result the link loses context. I enjoyed reading through your site where I mostly just read text, and the many links were there in the background if I wanted to expand that text.

Probably missing many other points, but that’s my though for the moment. I want my Bike outline to work like that! :slight_smile:

4 Likes

Out of curiosity, have you considered allowing a style option to render links as underlined text in the upcoming styling settings? I’ve found that using color for links can be a bit subtle, particularly in dark mode, where a colored link is sometimes made to appear darker than the other text, which can be harder to read. I always liked the simple underline (particularly if the color of the underline can be controlled!) as one possible option.

I think so … I expect first version of styling will be limited, just getting system in place. Then I’ll expand.

1 Like

A couple of tentative additions below:

  • an interim approach to Bike task row handling,
  • inclusion of strikethrough formatting.
Expand disclosure triangle to view XSLT source
<?xml version="1.0"?>

<xsl:stylesheet version="2.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xhtml">

    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:strip-space elements="*" />

    <!-- Draft extension of Jon Sterling's jms-0084 template
         http://www.jonmsterling.com/jms-0084.xml

         1. Handles Bike task rows by prepending Unicode ballot box chars.  
         2. Includes Bike strikethrough (xhtml:s)
         
         Note: Pandoc reads ballot chars from HTML back to MD - [ ] and - [x], 
         and in time it should also read the task output format of the HTML writer.

         See: https://github.com/jgm/pandoc/issues/9047

         Rob Trew @2023-09-04
         Draft adjustment 0.1
    -->

    <xsl:template match="xhtml:html | xhtml:body | xhtml:code | xhtml:strong | xhtml:em | xhtml:mark | xhtml:s">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*">
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>

    <!-- Bike leaves a lot of empty <span> elements behind; we drop these. -->
    <xsl:template match="xhtml:span">
        <xsl:apply-templates />
    </xsl:template>

    <!-- 
  Bike uses <ul> for all lists; the list type is determined not at this level, but rather by each
  individual item's @data-type attribute. To get this data into the HTML list model, we must group
  items that have the same @data-type and wrap them in an appropriate list-forming element.
  
  To do this, we use XSLT 2.0's <xsl:for-each-group> instruction to group adjacent <li> items by
  their @data-type attribute. We must convert @data-type to a string: otherwise, the transformer
  will crash when it encounters an item without a @data-type attribute.
  -->
    <xsl:template match="xhtml:ul">
        <xsl:for-each-group select="xhtml:li" group-adjacent="string(@data-type)">
            <xsl:choose>
                <xsl:when test="@data-type='ordered'">
                    <ol>
                        <xsl:apply-templates select="current-group()" />
                    </ol>
                </xsl:when>
                <xsl:when test="@data-type='unordered' or @data-type='task'">
                    <ul>
                        <xsl:apply-templates select="current-group()" />
                    </ul>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:apply-templates select="current-group()" />
                </xsl:otherwise>
            </xsl:choose>
        </xsl:for-each-group>
    </xsl:template>

    <xsl:template match="xhtml:li">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="xhtml:li[@data-type='ordered' or @data-type='unordered']/xhtml:p">
        <li>
            <xsl:apply-templates />
        </li>
    </xsl:template>

    <xsl:template match="xhtml:li[@data-type='task']/xhtml:p">
        <li>
            <p>
                <xsl:choose>
                    <xsl:when test="../@data-done">
                    &#9746; <xsl:apply-templates />
                    </xsl:when>
                    <xsl:otherwise>
                    &#9744; <xsl:apply-templates />
                    </xsl:otherwise>
                </xsl:choose>
            </p>
        </li>
    </xsl:template>

    <xsl:template match="xhtml:li[@data-type='heading']/xhtml:p">
        <xsl:element name="h{count(ancestor::xhtml:li[@data-type='heading'])}">
            <xsl:apply-templates />
        </xsl:element>
    </xsl:template>

    <xsl:template match="xhtml:li[@data-type='quote']/xhtml:p">
        <blockquote>
            <xsl:apply-templates />
        </blockquote>
    </xsl:template>

    <xsl:template match="xhtml:li[@data-type='note']/xhtml:p">
        <p>
            <em>
                <xsl:apply-templates />
            </em>
        </p>
    </xsl:template>

    <xsl:template match="xhtml:li[not(@data-type)]/xhtml:p">
        <p>
            <xsl:apply-templates />
        </p>
    </xsl:template>

</xsl:stylesheet>
1 Like

@complexpoint This looks fine, would you like to submit a Git patch to ~jonsterling/public-inbox@lists.sr.ht using the instructions here? https://git-send-email.io

[If this is too arduous, lmk and I will adapt your changes when I have a chance.]

Seems to have gone through.

1 Like

thanks! I’ve replied with minor feedback — but it looks like my email to you bounced off your address. You can reach the thread here though: [PATCH] Handle tasks and strikethrough v0.1 — sourcehut lists

Thank you for your patience – I think I’ve fixed the email address and sent a two-spaced amendment now.

1 Like