rdoc-markdown 0.3 → 0.3.1
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/README.md +13 -10
 - data/lib/rdoc/generator/markdown.rb +1 -1
 - data/lib/rdoc/markdown/version.rb +1 -1
 - data/lib/templates/classfile.md.erb +1 -1
 - metadata +2 -7
 - data/.DS_Store +0 -0
 - data/docs/example.rb +0 -142
 - data/lib/.DS_Store +0 -0
 - data/lib/rdoc/.DS_Store +0 -0
 - data/publish.sh +0 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 99635a266dfc1546b1a4a41750981273801ce18843b28ac988bc3f5c15574bb9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d57652a1afeeec572a6af5261d05a4873c2a2cf92ab2902a5da43674a62ad6ba
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 952daaa29c6f9cf001a3e355c311decc519eebe65197f38cdcf997990e6ca1cc6dacd21c999de6b48a7a14fd2d2d770c771f0030c1dacd70981dc9deab116d10
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 18f3c998cb1a7a0ec875c30713fcc63fdbe4d61c762256e9175e96364c9eff4ca8f877a7db0c572e35c12eff4775ef33b097ee108fa78252491fa41db775c403
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,9 +1,12 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #  
     | 
| 
       2 
     | 
    
         
            -
            RDoc plugin to generate markdown documentation and search index  
     | 
| 
      
 1 
     | 
    
         
            +
            # RDoc-Markdown
         
     | 
| 
      
 2 
     | 
    
         
            +
            RDoc plugin to generate markdown documentation and search index backed by sqlite database.
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            ## Motivation
         
     | 
| 
      
 5 
     | 
    
         
            +
            I'm trying to depend less on software with GUI, instead using software that could be used through console. **Documentation in markdown format allows me to review documentation in console**, instead of browser or GUI software like DevDocs.
         
     | 
| 
       3 
6 
     | 
    
         | 
| 
       4 
7 
     | 
    
         
             
            ## Installation
         
     | 
| 
       5 
8 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
            Install  
     | 
| 
      
 9 
     | 
    
         
            +
            Install gem and add to application's Gemfile by executing:
         
     | 
| 
       7 
10 
     | 
    
         | 
| 
       8 
11 
     | 
    
         
             
                $ bundle add rdoc-markdown
         
     | 
| 
       9 
12 
     | 
    
         | 
| 
         @@ -12,10 +15,13 @@ If bundler is not being used to manage dependencies, install the gem by executin 
     | 
|
| 
       12 
15 
     | 
    
         
             
                $ gem install rdoc-markdown
         
     | 
| 
       13 
16 
     | 
    
         | 
| 
       14 
17 
     | 
    
         
             
            ## Usage
         
     | 
| 
      
 18 
     | 
    
         
            +
            RDoc will auto-detect rdoc-markdown plugin if it was installed. You just need to instruct RDoc to produce markdown output instead of standard HTML through `format` parameter.
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            Run following command in directory with ruby source code:
         
     | 
| 
       15 
21 
     | 
    
         | 
| 
       16 
22 
     | 
    
         
             
            `rdoc --format=markdown`
         
     | 
| 
       17 
23 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
      
 24 
     | 
    
         
            +
            This will produce a tree of markdown documents and search index in `/doc` folder. Every class in library will have it's own markdown file.
         
     | 
| 
       19 
25 
     | 
    
         | 
| 
       20 
26 
     | 
    
         
             
            ## Development
         
     | 
| 
       21 
27 
     | 
    
         
             
            Biggest issue is testing this locally, but that's not as hard to do these days.
         
     | 
| 
         @@ -34,22 +40,19 @@ or you can do the same, but through gemfile: 
     | 
|
| 
       34 
40 
     | 
    
         
             
            gem 'rdoc-markdown`, path: "../rdoc-markdown/`
         
     | 
| 
       35 
41 
     | 
    
         
             
            ```
         
     | 
| 
       36 
42 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
            I have scripted entire process in [rm-reload.sh script](https://github.com/skatkov/gum/blob/master/rm-reload.sh). But it assumes, that you have [gum library](https://github.com/charmbracelet/gum) installed.
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
43 
     | 
    
         
             
            ## Testing
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
      
 44 
     | 
    
         
            +
            Following command should run entire testsuit:
         
     | 
| 
       42 
45 
     | 
    
         
             
            ```
         
     | 
| 
       43 
46 
     | 
    
         
             
            rake test
         
     | 
| 
       44 
47 
     | 
    
         
             
            ```
         
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
      
 48 
     | 
    
         
            +
            Testing is not excessive, just verifies that basic functionality is operational.
         
     | 
| 
       46 
49 
     | 
    
         
             
            ## Release
         
     | 
| 
       47 
50 
     | 
    
         
             
            ```
         
     | 
| 
       48 
51 
     | 
    
         
             
            gem build rdoc-markdown.gemspec
         
     | 
| 
       49 
52 
     | 
    
         
             
            gem push rdoc-markdown-0.1.2.gem
         
     | 
| 
       50 
53 
     | 
    
         
             
            ```
         
     | 
| 
       51 
54 
     | 
    
         | 
| 
       52 
     | 
    
         
            -
            There is `./publish.sh` script that does that. But it assumes, that you have [gum library](https://github.com/charmbracelet/gum) installed.
         
     | 
| 
      
 55 
     | 
    
         
            +
            There is `./bin/publish.sh` script that does that. But it assumes, that you have [gum library](https://github.com/charmbracelet/gum) installed.
         
     | 
| 
       53 
56 
     | 
    
         | 
| 
       54 
57 
     | 
    
         
             
            ## Contributing
         
     | 
| 
       55 
58 
     | 
    
         | 
| 
         @@ -177,7 +177,7 @@ class RDoc::Generator::Markdown 
     | 
|
| 
       177 
177 
     | 
    
         
             
                md.unindent!
         
     | 
| 
       178 
178 
     | 
    
         | 
| 
       179 
179 
     | 
    
         
             
                # Replace .html to .md extension in all markdown links
         
     | 
| 
       180 
     | 
    
         
            -
                md 
     | 
| 
      
 180 
     | 
    
         
            +
                md.gsub(/\[(.+)\]\((.+).html(.*)\)/) do |_|
         
     | 
| 
       181 
181 
     | 
    
         
             
                  match = Regexp.last_match
         
     | 
| 
       182 
182 
     | 
    
         | 
| 
       183 
183 
     | 
    
         
             
                  "[#{match[1]}](#{match[2]}.md#{match[3]})"
         
     | 
| 
         @@ -13,7 +13,7 @@ 
     | 
|
| 
       13 
13 
     | 
    
         
             
              <% unless attributes&.empty? %>
         
     | 
| 
       14 
14 
     | 
    
         
             
            ## Attributes
         
     | 
| 
       15 
15 
     | 
    
         
             
                <% attributes.each do |attr| %>
         
     | 
| 
       16 
     | 
    
         
            -
            ### <%= attr. 
     | 
| 
      
 16 
     | 
    
         
            +
            ### <%= attr.name %>[<%= attr.rw %>] [](#<%= attr.aref.strip %>)
         
     | 
| 
       17 
17 
     | 
    
         
             
            <% if attr.comment %> <%= h attr.description %> <%else%> (Not documented) <% end %>
         
     | 
| 
       18 
18 
     | 
    
         
             
                <% end %>
         
     | 
| 
       19 
19 
     | 
    
         
             
              <% end %>
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rdoc-markdown
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Stanislav (Stas) Katkov
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-11-05 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rdoc
         
     | 
| 
         @@ -158,7 +158,6 @@ executables: [] 
     | 
|
| 
       158 
158 
     | 
    
         
             
            extensions: []
         
     | 
| 
       159 
159 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       160 
160 
     | 
    
         
             
            files:
         
     | 
| 
       161 
     | 
    
         
            -
            - ".DS_Store"
         
     | 
| 
       162 
161 
     | 
    
         
             
            - ".editorconfig"
         
     | 
| 
       163 
162 
     | 
    
         
             
            - ".standard.yml"
         
     | 
| 
       164 
163 
     | 
    
         
             
            - CODE_OF_CONDUCT.md
         
     | 
| 
         @@ -167,15 +166,11 @@ files: 
     | 
|
| 
       167 
166 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       168 
167 
     | 
    
         
             
            - README.md
         
     | 
| 
       169 
168 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       170 
     | 
    
         
            -
            - docs/example.rb
         
     | 
| 
       171 
     | 
    
         
            -
            - lib/.DS_Store
         
     | 
| 
       172 
169 
     | 
    
         
             
            - lib/markdown.rb
         
     | 
| 
       173 
     | 
    
         
            -
            - lib/rdoc/.DS_Store
         
     | 
| 
       174 
170 
     | 
    
         
             
            - lib/rdoc/discover.rb
         
     | 
| 
       175 
171 
     | 
    
         
             
            - lib/rdoc/generator/markdown.rb
         
     | 
| 
       176 
172 
     | 
    
         
             
            - lib/rdoc/markdown/version.rb
         
     | 
| 
       177 
173 
     | 
    
         
             
            - lib/templates/classfile.md.erb
         
     | 
| 
       178 
     | 
    
         
            -
            - publish.sh
         
     | 
| 
       179 
174 
     | 
    
         
             
            - sig/rdoc/markdown.rbs
         
     | 
| 
       180 
175 
     | 
    
         
             
            homepage: https://poshtui.com
         
     | 
| 
       181 
176 
     | 
    
         
             
            licenses:
         
     | 
    
        data/.DS_Store
    DELETED
    
    | 
         Binary file 
     | 
    
        data/docs/example.rb
    DELETED
    
    | 
         @@ -1,142 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ##
         
     | 
| 
       2 
     | 
    
         
            -
            # === RDoc::Generator::Markdown example.
         
     | 
| 
       3 
     | 
    
         
            -
            #
         
     | 
| 
       4 
     | 
    
         
            -
            # This example employs various RDoc features to demonstrate
         
     | 
| 
       5 
     | 
    
         
            -
            # generator output.
         
     | 
| 
       6 
     | 
    
         
            -
            #
         
     | 
| 
       7 
     | 
    
         
            -
            # ---
         
     | 
| 
       8 
     | 
    
         
            -
            #
         
     | 
| 
       9 
     | 
    
         
            -
            # Links:
         
     | 
| 
       10 
     | 
    
         
            -
            #
         
     | 
| 
       11 
     | 
    
         
            -
            #  1. {Project Home Page}[https://github.com/skatkov/rdoc-markdown)
         
     | 
| 
       12 
     | 
    
         
            -
            #  2. {RDoc Documentation}[http://ruby-doc.org/stdlib-2.0.0/libdoc/rdoc/rdoc/RDoc/Markup.html]
         
     | 
| 
       13 
     | 
    
         
            -
            #
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
            ##
         
     | 
| 
       16 
     | 
    
         
            -
            # A mixin for waterfowl creatures.
         
     | 
| 
       17 
     | 
    
         
            -
            module Waterfowl
         
     | 
| 
       18 
     | 
    
         
            -
                # Swimming helper.
         
     | 
| 
       19 
     | 
    
         
            -
                def swim
         
     | 
| 
       20 
     | 
    
         
            -
                  puts 'swimming around'
         
     | 
| 
       21 
     | 
    
         
            -
                end
         
     | 
| 
       22 
     | 
    
         
            -
              end
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
              ##
         
     | 
| 
       25 
     | 
    
         
            -
              # The base class for all birds.
         
     | 
| 
       26 
     | 
    
         
            -
              class Bird
         
     | 
| 
       27 
     | 
    
         
            -
                ##
         
     | 
| 
       28 
     | 
    
         
            -
                # Produce some noise.
         
     | 
| 
       29 
     | 
    
         
            -
                #--
         
     | 
| 
       30 
     | 
    
         
            -
                # FIXME: maybe extract this to a base class +Animal+?
         
     | 
| 
       31 
     | 
    
         
            -
                #++
         
     | 
| 
       32 
     | 
    
         
            -
                def speak # :yields: text
         
     | 
| 
       33 
     | 
    
         
            -
                  puts 'generic tweeting'
         
     | 
| 
       34 
     | 
    
         
            -
                  yield 'tweet'
         
     | 
| 
       35 
     | 
    
         
            -
                  yield 'tweet'
         
     | 
| 
       36 
     | 
    
         
            -
                end
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
                # Fly somewhere.
         
     | 
| 
       39 
     | 
    
         
            -
                #
         
     | 
| 
       40 
     | 
    
         
            -
                # Flying is the most critical feature of birds.
         
     | 
| 
       41 
     | 
    
         
            -
                #
         
     | 
| 
       42 
     | 
    
         
            -
                # :args: direction, velocity
         
     | 
| 
       43 
     | 
    
         
            -
                #
         
     | 
| 
       44 
     | 
    
         
            -
                # :call-seq:
         
     | 
| 
       45 
     | 
    
         
            -
                #   Bird.fly(symbol, number) -> bool
         
     | 
| 
       46 
     | 
    
         
            -
                #   Bird.fly(string, number) -> bool
         
     | 
| 
       47 
     | 
    
         
            -
                #
         
     | 
| 
       48 
     | 
    
         
            -
                # = Example
         
     | 
| 
       49 
     | 
    
         
            -
                #
         
     | 
| 
       50 
     | 
    
         
            -
                #   fly(:south, 70)
         
     | 
| 
       51 
     | 
    
         
            -
                def fly(direction, velocity)
         
     | 
| 
       52 
     | 
    
         
            -
                  _fly_impl(direction, velocity)
         
     | 
| 
       53 
     | 
    
         
            -
                end
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
                def _fly_impl(_direction, _velocity) # :nodoc:
         
     | 
| 
       56 
     | 
    
         
            -
                  puts "flying away: direction=#{direction}, velocity=#{velocity}"
         
     | 
| 
       57 
     | 
    
         
            -
                end
         
     | 
| 
       58 
     | 
    
         
            -
              end
         
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
              ##
         
     | 
| 
       61 
     | 
    
         
            -
              # A duck is a Waterfowl Bird.
         
     | 
| 
       62 
     | 
    
         
            -
              #
         
     | 
| 
       63 
     | 
    
         
            -
              # Features:
         
     | 
| 
       64 
     | 
    
         
            -
              #
         
     | 
| 
       65 
     | 
    
         
            -
              #  bird::
         
     | 
| 
       66 
     | 
    
         
            -
              #
         
     | 
| 
       67 
     | 
    
         
            -
              #    * speak
         
     | 
| 
       68 
     | 
    
         
            -
              #    * fly
         
     | 
| 
       69 
     | 
    
         
            -
              #
         
     | 
| 
       70 
     | 
    
         
            -
              #  waterfowl::
         
     | 
| 
       71 
     | 
    
         
            -
              #
         
     | 
| 
       72 
     | 
    
         
            -
              #    * swim
         
     | 
| 
       73 
     | 
    
         
            -
              class Duck
         
     | 
| 
       74 
     | 
    
         
            -
                extend Animal
         
     | 
| 
       75 
     | 
    
         
            -
                include Waterfowl
         
     | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
       77 
     | 
    
         
            -
                # :section: Bird overrides
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
                # Duck overrides generic implementation.
         
     | 
| 
       80 
     | 
    
         
            -
                def speak
         
     | 
| 
       81 
     | 
    
         
            -
                  speech = quack
         
     | 
| 
       82 
     | 
    
         
            -
                  yield speech
         
     | 
| 
       83 
     | 
    
         
            -
                end
         
     | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
       85 
     | 
    
         
            -
                # Implements quacking
         
     | 
| 
       86 
     | 
    
         
            -
                def quack
         
     | 
| 
       87 
     | 
    
         
            -
                  'quack'
         
     | 
| 
       88 
     | 
    
         
            -
                end
         
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
                private :quack
         
     | 
| 
       91 
     | 
    
         
            -
             
     | 
| 
       92 
     | 
    
         
            -
                # :section: Duck extensions
         
     | 
| 
       93 
     | 
    
         
            -
             
     | 
| 
       94 
     | 
    
         
            -
                # True for domestic ducks.
         
     | 
| 
       95 
     | 
    
         
            -
                attr_accessor :domestic
         
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
       97 
     | 
    
         
            -
                # True for rubber ducks.
         
     | 
| 
       98 
     | 
    
         
            -
                attr_reader :rubber
         
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
     | 
    
         
            -
                MAX_VELOCITY = 130 # Maximum velocity for a flying duck.
         
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
                ##
         
     | 
| 
       103 
     | 
    
         
            -
                # Global list of all rubber ducks.
         
     | 
| 
       104 
     | 
    
         
            -
                #
         
     | 
| 
       105 
     | 
    
         
            -
                # Use when in trouble.
         
     | 
| 
       106 
     | 
    
         
            -
                @@rubber_ducks = []
         
     | 
| 
       107 
     | 
    
         
            -
             
     | 
| 
       108 
     | 
    
         
            -
                # Returns list of all rubber ducks.
         
     | 
| 
       109 
     | 
    
         
            -
                def self.rubber_ducks
         
     | 
| 
       110 
     | 
    
         
            -
                  @@rubber_ducks
         
     | 
| 
       111 
     | 
    
         
            -
                end
         
     | 
| 
       112 
     | 
    
         
            -
             
     | 
| 
       113 
     | 
    
         
            -
                # Creates a new duck.
         
     | 
| 
       114 
     | 
    
         
            -
                def initialize(domestic, rubber)
         
     | 
| 
       115 
     | 
    
         
            -
                  @domestic = domestic
         
     | 
| 
       116 
     | 
    
         
            -
                  @rubber = rubber
         
     | 
| 
       117 
     | 
    
         
            -
                  @@rubber_ducks << self if rubber
         
     | 
| 
       118 
     | 
    
         
            -
                end
         
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
                # Checks if this duck is a useful one.
         
     | 
| 
       121 
     | 
    
         
            -
                #
         
     | 
| 
       122 
     | 
    
         
            -
                # :call-seq:
         
     | 
| 
       123 
     | 
    
         
            -
                #   Bird.useful? -> bool
         
     | 
| 
       124 
     | 
    
         
            -
                def useful?
         
     | 
| 
       125 
     | 
    
         
            -
                  @domestic || @rubber
         
     | 
| 
       126 
     | 
    
         
            -
                end
         
     | 
| 
       127 
     | 
    
         
            -
              end
         
     | 
| 
       128 
     | 
    
         
            -
             
     | 
| 
       129 
     | 
    
         
            -
              # Default velocity for a flying duck.
         
     | 
| 
       130 
     | 
    
         
            -
              DEFAULT_DUCK_VELOCITY = 70
         
     | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
       132 
     | 
    
         
            -
              # Default rubber duck.
         
     | 
| 
       133 
     | 
    
         
            -
              #
         
     | 
| 
       134 
     | 
    
         
            -
              # *Note:*
         
     | 
| 
       135 
     | 
    
         
            -
              #  Global variables are evil, but rubber ducks are worth it.
         
     | 
| 
       136 
     | 
    
         
            -
              $default_rubber_duck = Duck.new(false, true)
         
     | 
| 
       137 
     | 
    
         
            -
             
     | 
| 
       138 
     | 
    
         
            -
              # Domestic rubber duck.
         
     | 
| 
       139 
     | 
    
         
            -
              #
         
     | 
| 
       140 
     | 
    
         
            -
              # *Note:*
         
     | 
| 
       141 
     | 
    
         
            -
              #  This is weird... Thus not making it global.
         
     | 
| 
       142 
     | 
    
         
            -
              domestic_rubber_duck = Duck.new(true, true)
         
     | 
    
        data/lib/.DS_Store
    DELETED
    
    | 
         Binary file 
     | 
    
        data/lib/rdoc/.DS_Store
    DELETED
    
    | 
         Binary file 
     |