Skip to content

Commit 83d9824

Browse files
author
Ashe Connor
authored
Merge pull request #1173 from JJ/master
Adds POD6, the markup language for Perl6, to the repo
2 parents 11a355b + 455a75d commit 83d9824

File tree

15 files changed

+359
-8
lines changed

15 files changed

+359
-8
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
pkg/
33
.bundle
44
Gemfile.lock
5-
vendor/
65
.project
76
.buildpath
7+
*~

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "vendor/Pod-To-HTML"]
2+
path = vendor/Pod-To-HTML
3+
url = https://github.com/perl6/Pod-To-HTML

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ notifications:
1414
git:
1515
depth: 10
1616
before_install:
17+
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 379CE192D401AB61
18+
- echo "deb https://dl.bintray.com/nxadm/rakudo-pkg-debs `lsb_release -cs` main" | sudo tee -a /etc/apt/sources.list.d/rakudo-pkg.list
1719
- sudo apt-get update -qq
18-
- sudo apt-get install perl
20+
- sudo apt-get install perl rakudo-pkg
21+
- export PATH=$PATH:/.perl6/bin:/opt/rakudo-pkg/bin && install-zef-as-user && zef install Pod::To::HTML
1922
- curl -L http://cpanmin.us | perl - --sudo App::cpanminus
2023
- sudo cpanm --installdeps --notest Pod::Simple
2124
- sudo pip install docutils

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM ubuntu:trusty
2+
3+
RUN apt-get update -qq
4+
RUN apt-get install -y apt-transport-https
5+
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
8+
RUN apt-get update -qq
9+
10+
RUN apt-get install -y \
11+
perl rakudo-pkg curl git build-essential python python-pip \
12+
libssl-dev libreadline-dev zlib1g-dev \
13+
libicu-dev cmake pkg-config
14+
15+
ENV PATH $PATH:/opt/rakudo-pkg/bin
16+
RUN install-zef-as-user && zef install Pod::To::HTML
17+
18+
RUN curl -L http://cpanmin.us | perl - App::cpanminus
19+
RUN cpanm --installdeps --notest Pod::Simple
20+
21+
RUN pip install docutils
22+
23+
ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims
24+
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash
25+
RUN rbenv install 2.4.1
26+
RUN rbenv global 2.4.1
27+
RUN rbenv rehash
28+
29+
RUN gem install bundler
30+
31+
WORKDIR /data/github-markup
32+
COPY github-markup.gemspec .
33+
COPY Gemfile .
34+
COPY Gemfile.lock .
35+
COPY lib/github-markup.rb lib/github-markup.rb
36+
RUN bundle
37+
38+
ENV LC_ALL en_US.UTF-8
39+
RUN locale-gen en_US.UTF-8

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ you wish to run the library. You can also run `script/bootstrap` to fetch them a
2929
* [.asciidoc, .adoc, .asc](http://asciidoc.org/) -- `gem install asciidoctor` (http://asciidoctor.org)
3030
* [.pod](http://search.cpan.org/dist/perl/pod/perlpod.pod) -- `Pod::Simple::XHTML`
3131
comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
32-
32+
* [.pod6](https://docs.perl6.org/language/pod) -- No additional
33+
dependency beyond perl6 `Pod::To::HTML` (in stdlib)
3334

3435
Installation
3536
-----------
@@ -38,6 +39,14 @@ Installation
3839
gem install github-markup
3940
```
4041

42+
or
43+
44+
```
45+
bundle install
46+
```
47+
48+
from this directory.
49+
4150
Usage
4251
-----
4352

github-markup.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
1212
s.license = "MIT"
1313

1414
s.files = `git ls-files`.split($\)
15+
s.files += Dir['vendor/Pod-To-HTML/**/*']
1516
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
1617
s.test_files = s.files.grep(%r{^(test|spec|features)/})
1718
s.require_paths = %w[lib]
@@ -23,5 +24,5 @@ Gem::Specification.new do |s|
2324
s.add_development_dependency 'sanitize', '~> 2.1', '>= 2.1.0'
2425
s.add_development_dependency 'nokogiri', '~> 1.8.1'
2526
s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
26-
s.add_development_dependency "github-linguist", "~> 6.0"
27+
s.add_development_dependency "github-linguist", ">= 7.1.3"
2728
end

lib/github/commands/pod62html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env perl6
2+
3+
use v6;
4+
use lib $*PROGRAM.IO.parent.add: '../../../vendor/Pod-To-HTML';
5+
use Pod::To::HTML;
6+
7+
$_ = Pod::To::HTML.render(slurp);
8+
s:s{\<\!doctype html\>.*\<div id\=\"___top\"\>\<\/div\>\s*} = "";
9+
s:s{\s*\<\/div\>\s*\<\/body\>\s*\<\/html\>\s*} = "";
10+
.put;

lib/github/markup.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Markups
1919
MARKUP_RDOC = :rdoc
2020
MARKUP_RST = :rst
2121
MARKUP_TEXTILE = :textile
22+
MARKUP_POD6 = :pod6
2223
end
2324

2425
module Markup

lib/github/markup/implementation.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ def initialize(regexp, languages)
88
@regexp = regexp
99

1010
if defined?(::Linguist)
11-
@languages = languages.map {|l| Linguist::Language[l]}
11+
@languages = languages.map do |l|
12+
lang = Linguist::Language[l]
13+
raise "no match for language #{l.inspect}" if lang.nil?
14+
lang
15+
end
1216
end
1317
end
1418

0 commit comments

Comments
 (0)