Skip to content

Commit b73bc68

Browse files
committed
Fix build github pages, extract monokai css for gitlab and github.
1 parent ba208ee commit b73bc68

4 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/pages.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ jobs:
4444
uses: actions/configure-pages@v5
4545
with:
4646
base_path: "public"
47-
- name: Build documentation
48-
run: bundle exec rake documentation:build
47+
- name: Build pages
48+
run: bundle exec rake github:pages
49+
- name: Extracting css
50+
run: bundle exec rougify style monokai > public/monokai.css
4951
- name: Upload artifact
5052
uses: actions/upload-pages-artifact@v3
5153
with:

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ specs:
1414
pages:
1515
script:
1616
- bundle exec rake gitlab:page
17+
- bundle exec rougify style monokai > public/monokai.css
1718
artifacts:
1819
paths:
1920
# The folder that contains the files to be exposed at the Page URL

tasks/github.rake

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'org-ruby'
2+
3+
namespace :github do
4+
desc "Build page"
5+
task :pages do
6+
readme = File.open File.expand_path('README.org')
7+
readme_content = IO.readlines(readme)
8+
parser_options = { wrap_html: { css_files: ["monokai.css"] } }
9+
parser = Orgmode::Parser.new(readme_content, parser_options)
10+
public_dir = File.expand_path("public")
11+
Dir.mkdir(public_dir) unless Dir.exist?(public_dir)
12+
output = File.expand_path("index.html", "public")
13+
index = File.new(output, 'w')
14+
index.write(parser.to_html)
15+
index.close
16+
end
17+
end

tasks/gitlab.rake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace :gitlab do
77
index_content = IO.readlines(index)
88
parser_options = { wrap_html: { css_files: ["monokai.css"] } }
99
parser = Orgmode::Parser.new(index_content, parser_options)
10-
1110
public_dir = File.expand_path("public")
1211
Dir.mkdir(public_dir) unless Dir.exist?(public_dir)
1312
output = File.expand_path("index.html", "public")

0 commit comments

Comments
 (0)