Skip to content

Commit e603d5a

Browse files
authored
Merge pull request #1788 from Fuzzwah/fuzzwah-patch-1
remove python+docutils, use ruby-pandoc to convert rst files to html
2 parents 7deae54 + 32294f2 commit e603d5a

File tree

10 files changed

+105
-63
lines changed

10 files changed

+105
-63
lines changed

Dockerfile

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,67 @@
1-
FROM ubuntu:trusty
1+
FROM ubuntu:focal
22

33
RUN apt-get update -qq
4-
RUN apt-get install -y apt-transport-https
4+
RUN apt-get install -y \
5+
apt-transport-https \
6+
locales \
7+
software-properties-common \
8+
curl \
9+
gnupg2
510

6-
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 379CE192D401AB61
7-
RUN echo "deb https://dl.bintray.com/nxadm/rakudo-pkg-debs `lsb_release -cs` main" | tee -a /etc/apt/sources.list.d/rakudo-pkg.list
11+
# add the Raku repository
12+
RUN curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/gpg.0DD4CA7EB1C6CC6B.key' | gpg --dearmor >> /usr/share/keyrings/nxadm-pkgs-rakudo-pkg-archive-keyring.gpg
13+
RUN curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/config.deb.txt?distro=ubuntu&codename=focal&component=main' > /etc/apt/sources.list.d/nxadm-pkgs-rakudo-pkg.list
14+
# add the Node.js repository
15+
RUN curl -1sLf https://deb.nodesource.com/setup_20.x | bash
816
RUN apt-get update -qq
917

1018
RUN apt-get install -y \
11-
perl rakudo-pkg curl git build-essential \
12-
libssl-dev libreadline-dev zlib1g-dev \
13-
libicu-dev cmake pkg-config
19+
perl \
20+
rakudo-pkg \
21+
git \
22+
libssl-dev \
23+
libreadline-dev \
24+
zlib1g-dev \
25+
libicu-dev \
26+
cmake \
27+
build-essential \
28+
g++ \
29+
pkg-config \
30+
nodejs \
31+
libffi-dev \
32+
libyaml-dev \
33+
gcc \
34+
libxslt-dev \
35+
libxml2-dev \
36+
zlib1g-dev \
37+
libidn11-dev
1438

1539
ENV PATH $PATH:/opt/rakudo-pkg/bin
16-
RUN install-zef-as-user && zef install Pod::To::HTML
40+
RUN install-zef
41+
ENV PATH $PATH:/root/.raku/bin
42+
RUN zef install Pod::To::HTML2
1743

1844
RUN curl -L http://cpanmin.us | perl - App::cpanminus
1945
RUN cpanm --installdeps --notest Pod::Simple
2046

47+
# Install Rbenv and Ruby
48+
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv && echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && echo 'eval "$(rbenv init -)"' >> ~/.bashrc
49+
RUN git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
2150
ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims
22-
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash
23-
RUN rbenv install 2.4.1
24-
RUN rbenv global 2.4.1
25-
RUN rbenv rehash
51+
RUN cd /root/.rbenv/plugins/ruby-build && git pull && cd -
52+
ENV RUBY_VERSION 3.3.0
53+
RUN rbenv install $RUBY_VERSION && rbenv global $RUBY_VERSION && rbenv rehash
54+
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
55+
RUN gem install bundler:2.4.22
2656

27-
RUN gem install bundler
57+
RUN bundle config --global build.nokogiri --use-system-libraries
2858

2959
RUN dpkg -i https://github.com/jgm/pandoc/releases/download/3.1.12.1/pandoc-3.1.12.1-linux-amd64.tar.gz
3060

3161
WORKDIR /data/github-markup
3262
COPY github-markup.gemspec .
3363
COPY Gemfile .
34-
COPY Gemfile.lock .
35-
COPY lib/github-markup.rb lib/github-markup.rb
64+
ADD lib ./lib
3665
RUN bundle
3766

3867
ENV LC_ALL en_US.UTF-8

Gemfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
source "http://rubygems.org"
22
gemspec
33

4+
gem "nokogiri", force_ruby_platform: true
45
gem "posix-spawn", :platforms => :ruby
56
gem "redcarpet", :platforms => :ruby
67
gem "kramdown", :platforms => :jruby
78
gem "RedCloth"
8-
# using a tag version here because 0.18.3 was not published by the author to encourage users to upgrade.
9-
# however we want to bump up to this version since this has a security patch
10-
gem "commonmarker"
11-
gem "rdoc", "~>3.6"
12-
gem "org-ruby", "= 0.9.9"
13-
gem "creole", "~>0.3.6"
9+
gem "commonmarker", "= 1.0.4"
10+
gem 'rdoc', '~> 6.6', '>= 6.6.2'
11+
gem 'org-ruby', '~> 0.9.12'
12+
gem 'creole', '~> 0.5.0'
13+
gem 'idn-ruby', '~> 0.1.5'
14+
gem 'twitter-text', '~> 3.1'
1415
gem "wikicloth", "=0.8.3"
15-
gem "twitter-text", "~> 1.14"
16-
gem "asciidoctor", "~> 2.0.5"
17-
gem "rake", "~> 12"
18-
gem "pandoc-ruby", "= 2.1.10"
16+
gem 'asciidoctor', '~> 2.0', '>= 2.0.21'
17+
gem 'rake', '~> 13.1'
18+
gem 'pandoc-ruby', '~> 2.1', '>= 2.1.10'
19+

github-markup.gemspec

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
1-
require File.expand_path("../lib/github-markup", __FILE__)
2-
3-
Gem::Specification.new do |s|
4-
s.name = "github-markup"
5-
s.version = GitHub::Markup::VERSION
6-
s.summary = "The code GitHub uses to render README.markup"
7-
s.description = <<~DESC
8-
This gem is used by GitHub to render any fancy markup such as Markdown,
9-
Textile, Org-Mode, etc. Fork it and add your own!
10-
DESC
11-
s.authors = ["Chris Wanstrath"]
12-
s.email = "[email protected]"
13-
s.homepage = "https://github.com/github/markup"
14-
s.license = "MIT"
15-
16-
s.files = `git ls-files`.split($\)
17-
s.files += Dir['vendor/**/*']
18-
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
19-
s.test_files = s.files.grep(%r{^(test|spec|features)/})
20-
s.require_paths = %w[lib]
21-
22-
s.add_development_dependency 'rake', '~> 12'
23-
s.add_development_dependency 'activesupport', '~> 4.0'
24-
s.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
25-
s.add_development_dependency 'html-pipeline', '~> 1.0'
26-
s.add_development_dependency 'sanitize', '>= 4.6.3'
27-
s.add_development_dependency 'nokogiri', '~> 1.8.1'
28-
s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
29-
s.add_development_dependency "github-linguist", ">= 7.1.3"
30-
end
1+
# frozen_string_literal: true
2+
3+
require_relative "lib/github/markup/version"
4+
5+
Gem::Specification.new do |spec|
6+
spec.name = "github-markup"
7+
spec.version = GitHub::Markup::VERSION
8+
spec.homepage = "https://github.com/github/markup"
9+
spec.summary = "The code GitHub uses to render README.markup"
10+
spec.description = <<~DESC
11+
This gem is used by GitHub to render any fancy markup such as Markdown,
12+
Textile, Org-Mode, etc. Fork it and add your own!
13+
DESC
14+
spec.authors = ["Chris Wanstrath", "Rob Crouch"]
15+
spec.license = "MIT"
16+
17+
spec.metadata = {
18+
"bug_tracker_uri" => "https://github.com/github/markup/issues",
19+
"source_code_uri" => "https://github.com/github/markup"
20+
}
21+
22+
spec.required_ruby_version = ">= 2.4"
23+
24+
spec.files = Dir.glob("lib/**/*", File::FNM_DOTMATCH)
25+
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
26+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
27+
28+
spec.add_development_dependency 'rake', '~> 13.1'
29+
spec.add_development_dependency 'activesupport', '~> 7.1', '>= 7.1.3.2'
30+
spec.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
31+
spec.add_development_dependency 'html-pipeline', '~> 1.0'
32+
spec.add_development_dependency "sanitize", "~> 4.6", ">= 4.6.3"
33+
spec.add_development_dependency 'nokogiri', '~> 1.8.1'
34+
spec.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
35+
spec.add_development_dependency "github-linguist", "~> 7.1", ">= 7.1.3"
36+
37+
38+
end

lib/github-markup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module GitHub
22
module Markup
3-
VERSION = '4.0.2'
3+
VERSION = '4.0.3'
44
Version = VERSION
55
end
66
end

lib/github/markup/version.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module GitHub
2+
module Markup
3+
VERSION = '4.0.3'
4+
Version = VERSION
5+
end
6+
end

lib/github/markups.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
Asciidoctor.convert(content, :safe => :secure, :attributes => attributes)
4949
end
5050

51-
markup(::GitHub::Markups::MARKUP_RST, :rest2html, /re?st(\.txt)?/, ["reStructuredText"]) do |filename, content, options: {}|
52-
PandocRuby.convert(content, :from => 'rst', :to => 'html')
51+
markup(::GitHub::Markups::MARKUP_RST, :rst, /re?st(\.txt)?/, ["reStructuredText"]) do |filename, content, options: {}|
52+
PandocRuby.new(content, from: 'rst').to_html
5353
end
5454

5555
command(::GitHub::Markups::MARKUP_POD6, :pod62html, /pod6/, ["Pod 6"], "pod6")

script/bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -e
55
cd $(dirname "$0")/..
66

77
bundle install
8-
pip3 install docutils
8+

script/bootstrap.contrib

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ set -e
55
cd $(dirname "$0")/..
66

77
bundle install --path vendor/bundle
8-
virtualenv vendor/python && source vendor/python/bin/activate
9-
pip install docutils
108

119
echo ""
1210
echo "*** DONE ***"
1311
echo ""
14-
echo "activate python environment with 'source vendor/python/bin/activate'"
1512
echo "run tests with 'bundle exec rake'"

script/cibuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export RUBY_HEAP_SLOTS_INCREMENT=400000
1010
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
1111

1212
export PATH="/usr/share/rbenv/shims:$PATH"
13-
export RBENV_VERSION="1.9.3"
13+
export RBENV_VERSION="3.3.0"
1414

1515
# bootstrap gem environment changes
1616
echo "Bootstrapping gem environment ..."

test/markup_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
require 'github/markup'
66
require 'minitest/autorun'
77
require 'html/pipeline'
8+
require 'sanitize'
89
require 'nokogiri'
910
require 'nokogiri/diff'
1011

0 commit comments

Comments
 (0)