Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doriantaylor/rb-md-noko
In goes Markdown, out pops Nokogiri.
https://github.com/doriantaylor/rb-md-noko
Last synced: 24 days ago
JSON representation
In goes Markdown, out pops Nokogiri.
- Host: GitHub
- URL: https://github.com/doriantaylor/rb-md-noko
- Owner: doriantaylor
- License: apache-2.0
- Created: 2018-05-16T20:23:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-11T21:30:29.000Z (over 2 years ago)
- Last Synced: 2024-04-27T03:02:34.702Z (8 months ago)
- Language: Ruby
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MD::Noko: in goes Markdown, out comes Nokogiri
## Synopsis
```ruby
require 'md-noko'mdnk = MD::Noko.new
doc = mdnk.ingest File.open('lolwut.md')# or
doc = mdnk.ingest <` element which you can pass a URL,
* Creates a hierarchy of `` elements and places headings
and content inside,
* If the document contains exactly one `` which is the very first
thing in the file, it is copied into the ``, and removed from
the document body if determined to be redundant (i.e. unless it
contains markup elements and not strictly text),
* A `` element containing exactly one nested
`` element is converted into a single ``,
* Images on their own paragraph are transformed into a ``,
* Text nodes not descendants of `` are whitespace-normalized and
indentation is repaired.
The embedded `Redcarpet::Markdown` instance has the following flags set:* `:tables`
* `:fenced_code_blocks`
* `:quote`
* `:highlight`These are currently not exposed.
## Installation
The usual:
$ gem install md-noko
Or, [download it off rubygems.org](https://rubygems.org/gems/md-noko).
## Contributing
Bug reports and pull requests are welcome at
[the GitHub repository](https://github.com/doriantaylor/rb-md-noko).## Copyright & License
©2018 [Dorian Taylor](https://doriantaylor.com/)
This software is provided under
the [Apache License, 2.0](https://www.apache.org/licenses/LICENSE-2.0).