Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge reverse_adoc functionality into coradoc gem #51

Closed
ronaldtse opened this issue May 14, 2024 · 3 comments · Fixed by #56
Closed

Merge reverse_adoc functionality into coradoc gem #51

ronaldtse opened this issue May 14, 2024 · 3 comments · Fixed by #56
Assignees
Labels
enhancement New feature or request

Comments

@ronaldtse
Copy link
Contributor

The reverse_adoc functionality is closely tied to Coradoc, meaning that it parses HTML and then converts it into Coradoc objects, then allows Coradoc => AsciiDoc output.

We should now merge the reverse_adoc functionality directly into Coradoc since both are developed together.

So Coradoc will have a Coradoc.from_html(...) method, and Coradoc::Document.new.to_adoc method.

@ronaldtse ronaldtse added the enhancement New feature or request label May 14, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma May 14, 2024
@ronaldtse ronaldtse moved this from 🆕 New to 🏔 High priority in Metanorma May 14, 2024
@ronaldtse
Copy link
Contributor Author

@hmdne
Copy link
Contributor

hmdne commented May 21, 2024

Post merge test report:

[user@localhost tmp]$ podman run --rm -it ruby:3.3.0 bash
root@9ac867559c87:/# gem install reverse_adoc
Fetching ffi-1.16.3.gem
Fetching sys-proctable-1.3.0.gem
Fetching nokogiri-1.16.5-x86_64-linux.gem
Fetching reverse_markdown-1.4.0.gem
Fetching htmlentities-4.3.4.gem
Fetching public_suffix-5.0.5.gem
Fetching addressable-2.8.6.gem
Fetching css_parser-1.17.1.gem
Fetching premailer-1.11.1.gem
Fetching nokogiri-styles-0.1.2.gem
Fetching descriptive_statistics-2.5.1.gem
Fetching cliver-0.3.2.gem
Fetching word-to-markdown-1.1.8.gem
Fetching parslet-2.0.0.gem
Fetching oscal-0.1.1.gem
Fetching mathml2asciimath-0.0.14.gem
Fetching reverse_adoc-2.0.0.gem
Fetching marcel-1.0.4.gem
Fetching coradoc-0.3.0.gem
Building native extensions. This could take a while...
Successfully installed ffi-1.16.3
Successfully installed sys-proctable-1.3.0
Successfully installed nokogiri-1.16.5-x86_64-linux
Successfully installed reverse_markdown-1.4.0
Successfully installed htmlentities-4.3.4
Successfully installed public_suffix-5.0.5
Successfully installed addressable-2.8.6
Successfully installed css_parser-1.17.1
Successfully installed premailer-1.11.1
Successfully installed nokogiri-styles-0.1.2
Successfully installed descriptive_statistics-2.5.1
Successfully installed cliver-0.3.2
Successfully installed word-to-markdown-1.1.8
Successfully installed parslet-2.0.0
Successfully installed oscal-0.1.1
Successfully installed mathml2asciimath-0.0.14
Successfully installed marcel-1.0.4
Successfully installed coradoc-0.3.0
Successfully installed reverse_adoc-2.0.0
19 gems installed

A new release of RubyGems is available: 3.5.3 → 3.5.10!
Run `gem update --system 3.5.10` to update your installation.

root@9ac867559c87:/# reverse_adoc <<< "<b>Hello world</b>"
*Hello world*
root@9ac867559c87:/# ruby -rreverse_adoc -e 'p ReverseAdoc.convert("<b>Hello world</b>")'
Deprecated: reverse_adoc has been merged into coradoc gem.
| Please update your references from:
|   require 'reverse_adoc'
| To:
|   require 'coradoc/reverse_adoc'
|
| You are referencing an old require here:
|   <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:132:in `require'
|   <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:132:in `rescue in require'
|   <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:126:in `require'
|
| You should also replace 'coradoc' with 'reverse_adoc' in your gem dependencies.
| reverse_adoc 2.0.0 will be kept with 'coradoc' as the only dependency.
|
| Please also ensure that you replace all references to ReverseAdoc in your code
| with Coradoc::ReverseAdoc.
"*Hello world*"
root@9ac867559c87:/# 

@ronaldtse
Copy link
Contributor Author

Thank you @hmdne !

This line:

| You should also replace 'coradoc' with 'reverse_adoc' in your gem dependencies.

Should probably be:

| You should also replace 'reverse_adoc' with 'coradoc' in your gem dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants