Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rakudoc (aka POD6) markup language for Raku (formerly Perl 6) #1348

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ dist: trusty
sudo: required
language: ruby
rvm:
- 2.1.10
- 2.2.7
- 2.3.4
- 2.4.1
- 2.3.8
- 2.4.9
- 2.5.7
- 2.6.5
- 2.7.0
notifications:
email: false
git:
Expand All @@ -16,6 +17,12 @@ before_install:
- sudo apt-get update -qq
- sudo apt-get install perl rakudo-pkg
- export PATH=$PATH:/.perl6/bin:/opt/rakudo-pkg/bin
- export NVM_DIR=/usr/local/nvm
- export NODE_VERSION=12.16.1
- sudo mkdir -p $NVM_DIR
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | sudo bash
- export PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
- sudo env PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH npm install -g [email protected]
- curl -L http://cpanmin.us | perl - --sudo App::cpanminus
- sudo cpanm --installdeps --notest Pod::Simple
- sudo pip install docutils
Expand Down
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ RUN apt-get update -qq
RUN apt-get install -y \
perl rakudo-pkg curl git build-essential python python-pip \
libssl-dev libreadline-dev zlib1g-dev \
libicu-dev cmake pkg-config
libicu-dev cmake3 pkg-config


#####################################
# npm, nvm & yarn:
#####################################

# nvm environment variables
ENV NVM_DIR /usr/local/nvm
# latest LTS version
ENV NODE_VERSION 12.16.1
# node
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash

ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN npm install -g [email protected]


ENV PATH $PATH:/opt/rakudo-pkg/bin
RUN install-zef-as-user && zef install Pod::To::HTML
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ you wish to run the library. You can also run `script/bootstrap` to fetch them a
* [.asciidoc, .adoc, .asc](http://asciidoc.org/) -- `gem install asciidoctor` (http://asciidoctor.org)
* [.pod](http://search.cpan.org/dist/perl/pod/perlpod.pod) -- `Pod::Simple::XHTML`
comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
* [.pod6, .rakudoc](https://docs.raku.org/language/pod) -- `npm install pod6` (https://github.com/zag/js-pod6)

Installation
-----------
Expand Down
2 changes: 2 additions & 0 deletions lib/github/commands/pod6html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec pod6html "$@"
2 changes: 1 addition & 1 deletion lib/github/markups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
"restructuredtext"
)

command(::GitHub::Markups::MARKUP_POD6, :pod62html, /pod6/, ["Pod 6"], "pod6")
command(::GitHub::Markups::MARKUP_POD6, :pod6html, /pod6|rakudoc/, ["Pod 6"], "pod6")
command(::GitHub::Markups::MARKUP_POD, :pod2html, /pod/, ["Pod"], "pod")
53 changes: 53 additions & 0 deletions test/markups/README.pod6
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
=begin pod
=head1 Title
=head2 Subtitle

=for code :allow(B)
This I<is> a B<text>

=alias PROGNAME Earl Irradiatem Evermore
=alias VENDOR 4D Kingdoms
=alias TERMS_URLS =item L<http://www.4dk.com/eie>
= =item L<http://www.4dk.co.uk/eie.io/>
= =item L<http://www.fordecay.ch/canttouchthis>

The use of A<PROGNAME> is U<subject> to the terms and conditions
laid out by A<VENDOR>, as specified at:

A<TERMS_URLS>

=para
Use a C<for> loop instead.N<The Raku C<for> loop is far more
powerful than its Perl 5 predecessor.> Preferably with an explicit
iterator variable.

Options B<are>:

=item1 Animal
=item2 Vertebrate
=item2 Invertebrate

=item1 Phase
=item2 Solid
=item2 Liquid
=item2 Gas
=item2 I<Chocolate>

I<Table>

=begin table :caption('Super table!')
Secret
Superhero Identity Superpower
============= =============== ===================
The Shoveller Eddie Stevens King Arthur's
singing shovel

Blue Raja Geoffrey Smith Master of cutlery

Mr Furious Roy Orson Ticking time bomb
of fury

The Bowler Carol Pinnsler Haunted bowling ball

=end table
=end pod
58 changes: 58 additions & 0 deletions test/markups/README.pod6.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<h1>Title
</h1><h2>Subtitle
</h2><pre><code>This I&lt;is&gt; a <strong>text</strong>
</code></pre><pre><code>The use of A&lt;PROGNAME&gt; is U&lt;subject&gt; to the terms and conditions
laid out by A&lt;VENDOR&gt;, as specified at:
</code></pre><pre><code>A&lt;TERMS_URLS&gt;
</code></pre><p>Use a <code>for</code> loop instead.<sup><a href="#fn:1">[1]</a></sup> Preferably with an explicit
iterator variable.
</p><p>Options <strong>are</strong>:
</p><ul>
<li><p>Animal
</p></li>
<ul>
<li><p>Vertebrate
</p></li>
<li><p>Invertebrate
</p></li>
</ul>
<li><p>Phase
</p></li>
<ul>
<li><p>Solid
</p></li>
<li><p>Liquid
</p></li>
<li><p>Gas
</p></li>
<li><p><em>Chocolate</em>
</p></li>
</ul>
</ul><p><em>Table</em>
</p><table>Super table!<tr>
<th> Superhero </th>
<th> Secret Identity </th>
<th> Superpower</th>
</tr>
<tr>
<td> The Shoveller </td>
<td> Eddie Stevens </td>
<td> King Arthur's singing shovel</td>
</tr>
<tr>
<td> Blue Raja </td>
<td> Geoffrey Smith</td>
<td> Master of cutlery</td>
</tr>
<tr>
<td> Mr Furious </td>
<td> Roy Orson </td>
<td> Ticking time bomb of fury</td>
</tr>
<tr>
<td> The Bowler </td>
<td> Carol Pinnsler</td>
<td> Haunted bowling ball</td>
</tr>
</table><div><p><sup><a href="#fnref:1">[1]</a></sup> The Raku <code>for</code> loop is far more
powerful than its Perl 5 predecessor.</p></div>