Headline Generator for ```Github Markdown``` File to generate beautiful ```Google Fonts``` Headlines.
```ruby
{ font__google_fonts__h1__name: "Permanent Marker" }
```
```ruby
{ font__google_fonts__h1__name: "Playfair Display" }
```
```ruby
{ font__google_fonts__h1__name: "Roboto Condensed" }
```
```ruby
{ font__google_fonts__h1__name: "Sarina" }
```
```ruby
{ font__google_fonts__h1__name: "Sonsie One" }
```
```ruby
{ font__google_fonts__h1__name: "Trocchi" }
```
```ruby
{ font__google_fonts__h1__name: "UnifrakturMaguntia" }
```
```ruby
{ font__google_fonts__h1__name: "Zilla Slab Highlight" }
```
1. [Examples](#examples)
2. [Quickstart](#quickstart)
3. [Demo](#demo)
4. [Setup](#setup)
5. [Process](#process)
6. [Functions](#functions)
7. [Options](#options)
8. [Limitations](#limitations)
9. [Contributing](#contributing)
10. [License](#license)
11. [Code of Conduct](#code-of-conduct)
12. [Support my Work](#support-my-work)
**Single Title**
```ruby
require 'markdown_titles_to_svg'
svg = MarkdownTitlesToSvg.single(
'headline',
:h1,
{}
)
```
**Generate from Github Markdown**
```ruby
require 'markdown_titles_to_svg'
markdowns = [
'https://raw.githubusercontent.com/a6b8/a6b8/main/templates/readme.md'
]
MarkdownTitlesToSvg.generate(
markdowns,
'a6b8',
{}
)
```
Add this line to your application's Gemfile:
```ruby
gem 'markdown_headlines_to_svg'
```
And then execute:
$ bundle install
Or install it yourself as:
$ gem install markdown_headlines_to_svg
![](https://ruby-gem-downloads-badge.herokuapp.com/markdown_titles_to_svg?type=total&color=lightgray)
**A. Implementation**
> https://raw.githubusercontent.com/a6b8/a6b8/main/README.md
**B. Execution**
> https://github.com/a6b8/a6b8/blob/main/titles.sh
1. Run Command
```txt
mds = [ PATH_FILE1, PATH_FILE2 ]
markdown_headlines_to_svg.generate(
mds,
"github_profile_name",
options = {}
)
```
2. Prepare (Import) Font
``` txt
:h1 :default
| |
| mode | mode
---------- ----------
| | | |
v v v v
Local Google Fonts Local
```
3. Scrape Titles
``` txt
MD_FILE_ 1 QUEUE
------------------------------------------------------
| img src="../a/c/d/1.svg" alt="# Headline 1" ------|------> [ 0 ]
| |
| MD_FILE_2 |
| -----------------------------------------------------
| | img src="../b/c/d/1.svg" alt="# Headline 2" -----|-> [ 1 ]
|----| ... |
| img src="../c/d/e/2.svg" alt="Title 1" ----------|-> [ 2 ]
| ... |
[ 0 ] { text: 'Headline 1', type: :h1, output: '../a/c/d/1.svg' }
[ 1 ] { text: 'Headline 2', type: :h1, output: '../b/c/d/1.svg' }
[ 2 ] { text: 'Title 1', type: :default, output: '../c/d/e/2.svg' }
```
4. Add Style and Font Options
``` txt
default
+ user options
{ |
type: :h1, ---------------------|------------------
text: 'Headline 1', | |
output: '../a/c/d/1.svg', V V
style: <-------------------- options[ :style ][ :h1 ]
font: <---------------------- options[ :font ][ :h1 ]
},
{ ...
```
### .get_options()
Output all Parameter
```ruby
MarkdownTitlesToSvg.get_options()
# => { github: { profile: nil, ...
```
### .generate( [], '', {} )
Generate and store of Titles in all Files
```ruby
MarkdownTitlesToSvg.generate(
markdowns,
'a6b8',
{}
)
```
| **Type** | **Required** | **Description** | **Example** | **Description** |
|------:|:------|:------|:------|:------|
| **markdowns** | ```Array (of String)``` | Yes | ```[ '/markdown-titles-to-svg/main/README.md' ]``` | Define List of Markup |
| **github user name** | ```String``` | Yes | ```'a6b8'``` | Set Github User Name |
| **options** | ```Hash``` | No | ```'a6b8'``` | Change default options, see "options" for more Information. |
### .single( [], '', {} )
Generate a single Title and outputs a svg string.
```ruby
svg = MarkdownTitlesToSvg.single(
'headline',
:h1,
{}
)
# =>