asciidoctor-html 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -3
  3. data/README.md +28 -11
  4. data/Rakefile +15 -6
  5. data/assets/css/fonts/bootstrap-icons.woff +0 -0
  6. data/assets/css/fonts/bootstrap-icons.woff2 +0 -0
  7. data/assets/css/styles.css +5 -0
  8. data/assets/css/styles.css.map +1 -0
  9. data/exe/adoctohtml +6 -0
  10. data/lib/asciidoctor/html/bi_inline_macro.rb +25 -0
  11. data/lib/asciidoctor/html/book.rb +222 -0
  12. data/lib/asciidoctor/html/cli.rb +112 -0
  13. data/lib/asciidoctor/html/converter.rb +165 -24
  14. data/lib/asciidoctor/html/cref_inline_macro.rb +37 -0
  15. data/lib/asciidoctor/html/figure.rb +10 -10
  16. data/lib/asciidoctor/html/highlightjs.rb +99 -0
  17. data/lib/asciidoctor/html/list.rb +38 -0
  18. data/lib/asciidoctor/html/popovers.rb +49 -0
  19. data/lib/asciidoctor/html/ref_tree_processor.rb +134 -57
  20. data/lib/asciidoctor/html/template.rb +127 -0
  21. data/lib/asciidoctor/html/tree_walker.rb +3 -1
  22. data/lib/asciidoctor/html/utils.rb +6 -0
  23. data/lib/asciidoctor/html/webmanifest.rb +23 -0
  24. data/lib/asciidoctor/html.rb +13 -1
  25. data/lib/minitest/html_plugin.rb +18 -22
  26. metadata +52 -27
  27. data/docs/_config.yml +0 -5
  28. data/docs/_layouts/default.html +0 -25
  29. data/docs/_sass/_custom.scss +0 -35
  30. data/docs/_sass/_example.scss +0 -30
  31. data/docs/_sass/_figure.scss +0 -17
  32. data/docs/_sass/_olist.scss +0 -101
  33. data/docs/_sass/main.scss +0 -40
  34. data/docs/assets/css/fonts +0 -1
  35. data/docs/assets/css/styles.scss +0 -3
  36. data/docs/assets/img/cat1.jpg +0 -0
  37. data/docs/assets/img/cat2.jpg +0 -0
  38. data/docs/assets/img/cat3.jpg +0 -0
  39. data/docs/package-lock.json +0 -59
  40. data/docs/package.json +0 -6
  41. data/docs/site.webmanifest +0 -1
  42. data/lib/asciidoctor/html/olist.rb +0 -18
  43. data/lib/asciidoctor/html/version.rb +0 -7
  44. /data/{docs → assets/favicon}/android-chrome-192x192.png +0 -0
  45. /data/{docs → assets/favicon}/android-chrome-512x512.png +0 -0
  46. /data/{docs → assets/favicon}/apple-touch-icon.png +0 -0
  47. /data/{docs → assets/favicon}/favicon-16x16.png +0 -0
  48. /data/{docs → assets/favicon}/favicon-32x32.png +0 -0
  49. /data/{docs → assets/favicon}/favicon.ico +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6e85297e79175b7368e9ae82e293c18725f6e0ad1e72ce6fe8682727ff0e886
4
- data.tar.gz: 70cdb4172188ac661d1cc5cd321283885c9179758944f6fda1fb3cb7832b9f85
3
+ metadata.gz: ee8dae10172068a6042f6898e5f6b9d801a78a223437b0f82df70faffeb1f632
4
+ data.tar.gz: 3818250d4e4abc5a9a914c6fc2472b8ebc50aed01569134591b1f456fad5fa06
5
5
  SHA512:
6
- metadata.gz: 00bd98079da7bbc66b33d27d4250d03d6170c96c9ea2ba5a7ec7dbf3521478e9d52bfd0ff5eaeba7d59a0da55f12f40b3574f7bf400741616835e8281cb7fc0c
7
- data.tar.gz: d2a60517c01ecf107a2b0bc16bafe5ee80744284a7b3a64fe040f485b7bda6f25b7c78f2e4e7a11c2ae5924670ba3a681a9b03dd7e9c561f8a8ba313836560a2
6
+ metadata.gz: b582323d188aefb260a9fa2479c61bcb4ee207b333117a79c020c500547b5646f49d79bbaf97088d2c73e2906120245596bec4d21b7d0790fdbffe2005a41bc1
7
+ data.tar.gz: 70c63a302dce0d3ec6c0595af58e91952f0a48e6ff1b44d70979e3a9314dc18b6a57f55f4cd98ecee5d9a94e2cf5ed5209e8629c67ecaf522c475f5bc5251b51
data/.rubocop.yml CHANGED
@@ -3,10 +3,10 @@ AllCops:
3
3
  NewCops: enable
4
4
 
5
5
  Metrics/AbcSize:
6
- Max: 40
6
+ Max: 45
7
7
 
8
8
  Metrics/CyclomaticComplexity:
9
- Max: 15
9
+ Max: 20
10
10
 
11
11
  Metrics/PerceivedComplexity:
12
12
  Max: 20
@@ -15,7 +15,7 @@ Metrics/BlockNesting:
15
15
  Max: 5
16
16
 
17
17
  Metrics/MethodLength:
18
- Max: 30
18
+ Max: 35
19
19
 
20
20
  Metrics/ClassLength:
21
21
  Max: 200
data/README.md CHANGED
@@ -1,10 +1,8 @@
1
1
  [![Build](https://github.com/ravirajani/asciidoctor-html/actions/workflows/main.yml/badge.svg)](https://github.com/ravirajani/asciidoctor-html/actions/workflows/main.yml)
2
2
 
3
- # Asciidoctor::Html
3
+ # asciidoctor-html
4
4
 
5
- **The code in this repo is being actively developed and currently has limited functionality.**
6
-
7
- When complete, this gem will provide an alternative HTML converter for [Asciidoctor](https://github.com/asciidoctor/asciidoctor) as well as Jekyll-based book generator.
5
+ **The code in this repo is being actively developed. Use at your own risk.**
8
6
 
9
7
  ## Installation
10
8
 
@@ -19,21 +17,40 @@ If bundler is not being used to manage dependencies, install the gem by executin
19
17
  ```bash
20
18
  gem install asciidoctor-html
21
19
  ```
20
+ ## Configuration
21
+
22
+ See the documentation's [config.yml](docs/asciidoc/config.yml) for an example of a configuration file.
23
+ In a typical scenario, you would put your configuration file in the same directory as your AsciiDoc
24
+ sources.
22
25
 
23
- ## Usage
26
+ ## Basic Usage
24
27
 
25
- ```ruby
26
- require "asciidoctor"
27
- require "asciidoctor/html"
28
+ Assuming your config file is in the same directory as your AsciiDoc sources, execute:
28
29
 
29
- Asciidoctor.convert_file "mydoc.adoc"
30
+ ```shell
31
+ cd <ASCIIDOC_SOURCES_DIR>
32
+ adoctohtml [--watch]
30
33
  ```
31
34
 
32
35
  ## Development
33
36
 
34
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
37
+ After checking out the repo, run `bin/setup` to install dependencies.
38
+ Then, run `bundle exec rake` to run the tests. You can also run `bin/cli` to test the CLI after making changes.
39
+
40
+ Run `jekyll serve --livereload` inside the `docs/html` directory to preview your changes after running `bundle exec rake`.
41
+
42
+ To install this gem onto your local machine, run `bundle exec rake install`.
43
+ To release a new version, update the version number in `asciidoctor-html.gemspec`,
44
+ and then run
45
+
46
+ ```shell
47
+ bundle exec rake stylesheet
48
+ bundle exec rake release
49
+ ```
35
50
 
36
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
51
+ The first line runs the tests and builds the stylesheet `assets/css/styles.css`.
52
+ The second line creates a git tag for the version, pushes git commits and the created tag,
53
+ and pushes the `.gem` file to [rubygems.org](https://rubygems.org).
37
54
 
38
55
 
39
56
  ## License
data/Rakefile CHANGED
@@ -1,22 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require "jekyll"
5
4
  require "minitest/test_task"
5
+ require "rubocop/rake_task"
6
+ require "jekyll"
7
+ require "fileutils"
8
+ require_relative "lib/asciidoctor/html"
6
9
 
7
- Minitest::TestTask.create
10
+ JEKYLL_SITEDIR = "#{__dir__}/_site".freeze
11
+ JEKYLL_CSSDIR = "#{JEKYLL_SITEDIR}/assets/css".freeze
8
12
 
9
- require "rubocop/rake_task"
13
+ Minitest::TestTask.create
10
14
 
11
15
  RuboCop::RakeTask.new
12
16
 
13
- task build: %i[test rubocop] do
17
+ task jekyll: %i[test rubocop] do
14
18
  config = Jekyll.configuration({
15
- source: "./docs",
16
- destination: "./_site"
19
+ source: "#{__dir__}/docs/html",
20
+ destination: JEKYLL_SITEDIR
17
21
  })
18
22
  site = Jekyll::Site.new(config)
19
23
  Jekyll::Commands::Build.build site, config
20
24
  end
21
25
 
26
+ task stylesheet: %i[jekyll] do
27
+ FileUtils.mkdir_p Asciidoctor::Html::CSS_PATH, verbose: true
28
+ FileUtils.cp_r JEKYLL_CSSDIR, Asciidoctor::Html::ASSETS_PATH, verbose: true
29
+ end
30
+
22
31
  task default: %i[test rubocop]