Sha256: 78949ffbd63aca9c8020f7485f5d5af24551eccc6c52b98ba1ec240d42d367da
Contents?: true
Size: 1.19 KB
Versions: 6
Compression:
Stored size: 1.19 KB
Contents
### Reuse Text Use file inclusion to stay DRY (Don't Repeat Yourself). Maintain reusable text in a separate file, then include it wherever it's needed. #### File To Be Included ```includee.md```: ```markdown Text in includee file. ``` #### Includer File ```includer.md```: ```markdown Text in includer file. @[:markdown](includee.md) ``` The treatment token ```:markdown``` specifies that the included text is to be treated as more markdown. #### CLI You can use the command-line interface to perform the inclusion. ##### Command ```sh markdown_helper include --pristine includer.md included.md ``` (Option ```--pristine``` suppresses comment insertion.) #### API You can use the API to perform the inclusion. ##### Ruby Code ```include.rb```: ```ruby require 'markdown_helper' # Option :pristine suppresses comment insertion. markdown_helper = MarkdownHelper.new(:pristine => true) markdown_helper.include('includer.md', 'included.md') ``` ##### Command ```sh ruby include.rb ``` #### File with Inclusion Here's the output file, after inclusion. ```included.md```: ```markdown Text in includer file. Text in includee file. ```
Version data entries
6 entries across 6 versions & 1 rubygems