contentfs 0.6.2 → 0.7.0
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.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +6 -0
 - data/lib/contentfs/renderers/markdown.rb +31 -1
 - data/lib/contentfs/renderers/markdown/code.rb +2 -2
 - data/lib/contentfs/version.rb +1 -1
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d306cf3d13ffb780150e9666fa6693854dbc890661f394347bbea65ae70729f0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5c01ca933b98c6cdbb1d402796fcefc738a5557e5967ee2cf9ca802972a5d809
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3f2196a1436b9057ccb50a69bcd38bffa40c9d171e846bb6aa5bda478cb26a9677cfc294f8ea5543b6169673173040ea12603bbc06aa74af354350f9c613bad9
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2b4e549b0481a2da7fb093de521532f2e32865fdf7a275915c7ff46f8571f3b897b6449bce4de6e549999594d7286cacba73008b41e4186ee4a6ed547426f57a
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ## [v0.7.0](https://github.com/metabahn/contentfs/releases/tag/v0.7.0)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            *released on 2021-04-07*
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              * `add` [#15](https://github.com/metabahn/contentfs/pull/15) Add support for typed blockquotes ([bryanp](https://github.com/bryanp))
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
       1 
7 
     | 
    
         
             
            ## [v0.6.2](https://github.com/metabahn/contentfs/releases/tag/v0.6.2)
         
     | 
| 
       2 
8 
     | 
    
         | 
| 
       3 
9 
     | 
    
         
             
            *released on 2021-04-05*
         
     | 
| 
         @@ -8,7 +8,37 @@ module ContentFS 
     | 
|
| 
       8 
8 
     | 
    
         
             
                class Markdown
         
     | 
| 
       9 
9 
     | 
    
         
             
                  class << self
         
     | 
| 
       10 
10 
     | 
    
         
             
                    def render(content)
         
     | 
| 
       11 
     | 
    
         
            -
                      CommonMarker. 
     | 
| 
      
 11 
     | 
    
         
            +
                      renderer.render(CommonMarker.render_doc(content))
         
     | 
| 
      
 12 
     | 
    
         
            +
                    end
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                    private def renderer
         
     | 
| 
      
 15 
     | 
    
         
            +
                      ContentFSRenderer.new(options: [:DEFAULT, :UNSAFE])
         
     | 
| 
      
 16 
     | 
    
         
            +
                    end
         
     | 
| 
      
 17 
     | 
    
         
            +
                  end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                  class ContentFSRenderer < CommonMarker::HtmlRenderer
         
     | 
| 
      
 20 
     | 
    
         
            +
                    def blockquote(node)
         
     | 
| 
      
 21 
     | 
    
         
            +
                      blockquote_type = if (match = node.to_plaintext.strip.match(/\[(.*)\]/))
         
     | 
| 
      
 22 
     | 
    
         
            +
                        match[1]
         
     | 
| 
      
 23 
     | 
    
         
            +
                      end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                      blockquote_class = if blockquote_type
         
     | 
| 
      
 26 
     | 
    
         
            +
                        " class=\"#{blockquote_type}\""
         
     | 
| 
      
 27 
     | 
    
         
            +
                      end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                      block do
         
     | 
| 
      
 30 
     | 
    
         
            +
                        container("<blockquote#{sourcepos(node)}#{blockquote_class}>\n", "</blockquote>") do
         
     | 
| 
      
 31 
     | 
    
         
            +
                          node.each.with_index do |child, index|
         
     | 
| 
      
 32 
     | 
    
         
            +
                            content = if blockquote_class && index == 0
         
     | 
| 
      
 33 
     | 
    
         
            +
                              child.to_html.gsub("<p>[#{blockquote_type}] ", "<p>")
         
     | 
| 
      
 34 
     | 
    
         
            +
                            else
         
     | 
| 
      
 35 
     | 
    
         
            +
                              child
         
     | 
| 
      
 36 
     | 
    
         
            +
                            end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                            out(content)
         
     | 
| 
      
 39 
     | 
    
         
            +
                          end
         
     | 
| 
      
 40 
     | 
    
         
            +
                        end
         
     | 
| 
      
 41 
     | 
    
         
            +
                      end
         
     | 
| 
       12 
42 
     | 
    
         
             
                    end
         
     | 
| 
       13 
43 
     | 
    
         
             
                  end
         
     | 
| 
       14 
44 
     | 
    
         
             
                end
         
     | 
| 
         @@ -19,13 +19,13 @@ module ContentFS 
     | 
|
| 
       19 
19 
     | 
    
         
             
                      end
         
     | 
| 
       20 
20 
     | 
    
         
             
                    end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                    class SyntaxRenderer <  
     | 
| 
      
 22 
     | 
    
         
            +
                    class SyntaxRenderer < ContentFSRenderer
         
     | 
| 
       23 
23 
     | 
    
         
             
                      def code_block(node)
         
     | 
| 
       24 
24 
     | 
    
         
             
                        block do
         
     | 
| 
       25 
25 
     | 
    
         
             
                          language = node.fence_info.split(/\s+/)[0]
         
     | 
| 
       26 
26 
     | 
    
         
             
                          out("<div class=\"highlight\"><pre class=\"highlight #{language}\"><code>")
         
     | 
| 
       27 
27 
     | 
    
         
             
                          out(syntax_highlight(node.string_content, language))
         
     | 
| 
       28 
     | 
    
         
            -
                          out( 
     | 
| 
      
 28 
     | 
    
         
            +
                          out("</code></pre></div>")
         
     | 
| 
       29 
29 
     | 
    
         
             
                        end
         
     | 
| 
       30 
30 
     | 
    
         
             
                      end
         
     | 
| 
       31 
31 
     | 
    
         | 
    
        data/lib/contentfs/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: contentfs
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.7.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Bryan Powell
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-04- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-04-07 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: A structured content file system.
         
     | 
| 
       14 
14 
     | 
    
         
             
            email: bryan@metabahn.com
         
     | 
| 
         @@ -40,7 +40,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       40 
40 
     | 
    
         
             
              requirements:
         
     | 
| 
       41 
41 
     | 
    
         
             
              - - ">="
         
     | 
| 
       42 
42 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       43 
     | 
    
         
            -
                  version: 2. 
     | 
| 
      
 43 
     | 
    
         
            +
                  version: 2.6.7
         
     | 
| 
       44 
44 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       45 
45 
     | 
    
         
             
              requirements:
         
     | 
| 
       46 
46 
     | 
    
         
             
              - - ">="
         
     |