Skip to content

Commit 83c3200

Browse files
committed
switch from python-docutils to ruby-pandoc for rst files
1 parent a849a12 commit 83c3200

File tree

4 files changed

+8
-324
lines changed

4 files changed

+8
-324
lines changed

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN echo "deb https://dl.bintray.com/nxadm/rakudo-pkg-debs `lsb_release -cs` mai
88
RUN apt-get update -qq
99

1010
RUN apt-get install -y \
11-
perl rakudo-pkg curl git build-essential python python-pip \
11+
perl rakudo-pkg curl git build-essential \
1212
libssl-dev libreadline-dev zlib1g-dev \
1313
libicu-dev cmake pkg-config
1414

@@ -18,8 +18,6 @@ RUN install-zef-as-user && zef install Pod::To::HTML
1818
RUN curl -L http://cpanmin.us | perl - App::cpanminus
1919
RUN cpanm --installdeps --notest Pod::Simple
2020

21-
RUN pip install docutils
22-
2321
ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims
2422
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash
2523
RUN rbenv install 2.4.1
@@ -28,6 +26,8 @@ RUN rbenv rehash
2826

2927
RUN gem install bundler
3028

29+
RUN dpkg -i https://github.com/jgm/pandoc/releases/download/3.1.12.1/pandoc-3.1.12.1-linux-amd64.tar.gz
30+
3131
WORKDIR /data/github-markup
3232
COPY github-markup.gemspec .
3333
COPY Gemfile .

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ gem "wikicloth", "=0.8.3"
1515
gem "twitter-text", "~> 1.14"
1616
gem "asciidoctor", "~> 2.0.5"
1717
gem "rake"
18+
gem "pandoc-ruby", "= 2.1.10"

lib/github/commands/rest2html

-314
This file was deleted.

lib/github/markups.rb

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require "github/markup/markdown"
22
require "github/markup/rdoc"
33
require "shellwords"
4+
require 'pandoc-ruby'
45

56
markup_impl(::GitHub::Markups::MARKUP_MARKDOWN, ::GitHub::Markup::Markdown.new)
67

@@ -47,13 +48,9 @@
4748
Asciidoctor.convert(content, :safe => :secure, :attributes => attributes)
4849
end
4950

50-
command(
51-
::GitHub::Markups::MARKUP_RST,
52-
"python3 #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html",
53-
/re?st(\.txt)?/,
54-
["reStructuredText"],
55-
"restructuredtext"
56-
)
51+
markup(::GitHub::Markups::MARKUP_RST, :rest2html, /re?st(\.txt)?/, ["reStructuredText"]) do |filename, content, options: {}|
52+
PandocRuby.convert(content, :from => 'rst', :to => 'html')
53+
end
5754

5855
command(::GitHub::Markups::MARKUP_POD6, :pod62html, /pod6/, ["Pod 6"], "pod6")
5956
command(::GitHub::Markups::MARKUP_POD, :pod2html, /pod/, ["Pod"], "pod")

0 commit comments

Comments
 (0)