diff --git a/CHANGELOG b/CHANGELOG index 01f7100..826a2f4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +## 0.2.0 (2017-06-16) + + * Added the custom tab label option + * Fixed the missing `active` class of the first tab + * Fixed the missing `string` import + ## 0.1.0 (2017-03-01) - * Initial release \ No newline at end of file + * Initial release diff --git a/README.md b/README.md index b8f46a4..a900f57 100644 --- a/README.md +++ b/README.md @@ -2,33 +2,59 @@ [pypi-image]: https://img.shields.io/pypi/v/markdown-fenced-code-tabs.svg [pypi-link]: https://pypi.python.org/pypi/markdown-fenced-code-tabs - + # Markdown Code Tabs Extension Generates Bootstrap HTML Tabs for Consecutive Markdown Fenced Code Blocks ```md - ## Tabs + ```http + GET / HTTP/1.1 + User-Agent: MyClient/1.0.0 + Accept: application/vnd.travis-ci.2+json + Host: api.travis-ci.org + + HTTP/1.1 200 OK + Content-Type: application/json - ```curl - $ curl -O wget http://example.com/pk.zip + {"hello":"world"} ``` - ```wget - $ wget http://example.com/pk.zip + ```shell + $ travis raw / + {"hello":"world"} ``` - ## Single block + ```ruby + require 'travis' - ``` - $ ls -lisa + # You usually don't want to fire API requests manually + client = Travis::Client.new + client.get_raw('/') # => {"hello"=>"world"} + + client.get('/repos/sinatra/sinatra') + # => {"repo"=>#} ``` ``` -Becomes: +Becomes: ![Generated result](docs/images/img1.png) +To customize the tab label, add the `fct_label` option to your code block. + +```md + ```swift fct_label="Swift 2" + array.enumerate() + ``` + + ```swift fct_label="Swift 3" + array.enumerated() + ``` +``` + +![Generated result](docs/images/img2.png) + ## Installation Install the latest version with `pip`: @@ -51,11 +77,11 @@ If `True`, the extension will render a single code block as a tab. Default is `F `single_block_as_tab: True` generates: -![True single_block_as_tab](docs/images/img2.png) +![True single_block_as_tab](docs/images/img3.png) `single_block_as_tab: False` generates: -![False single_block_as_tab](docs/images/img3.png) +![False single_block_as_tab](docs/images/img4.png) ## License @@ -67,4 +93,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/docs/images/img1.png b/docs/images/img1.png index 2b72073..39e679f 100644 Binary files a/docs/images/img1.png and b/docs/images/img1.png differ diff --git a/docs/images/img2.png b/docs/images/img2.png index f191692..a6a1d09 100644 Binary files a/docs/images/img2.png and b/docs/images/img2.png differ diff --git a/docs/images/img3.png b/docs/images/img3.png index 211a540..9d4ac86 100644 Binary files a/docs/images/img3.png and b/docs/images/img3.png differ diff --git a/docs/images/img4.png b/docs/images/img4.png new file mode 100644 index 0000000..17df0ac Binary files /dev/null and b/docs/images/img4.png differ diff --git a/setup.py b/setup.py index 77d237f..6c4f8dc 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='markdown-fenced-code-tabs', - version='0.1.0', + version='0.2.0', url='https://github.com/yacir/markdown-fenced-code-tabs', py_modules=['markdown_fenced_code_tabs'], install_requires = ['markdown>=2.6'], @@ -22,4 +22,4 @@ 'Programming Language :: Python :: 3', 'Topic :: Text Processing' ] -) \ No newline at end of file +)