|
1 | | -[![PyPI][pypi-image]][pypi-link] |
2 | | - |
3 | | - [pypi-image]: https://img.shields.io/pypi/v/markdown-fenced-code-tabs.svg |
4 | | - [pypi-link]: https://pypi.python.org/pypi/markdown-fenced-code-tabs |
| 1 | +<p align="center"> |
| 2 | + <a href="https://pypi.python.org/pypi/markdown-fenced-code-tabs"> |
| 3 | + <img src="https://img.shields.io/pypi/v/markdown-fenced-code-tabs.svg"/> |
| 4 | + </a> |
| 5 | + <img src="https://img.shields.io/pypi/pyversions/markdown-fenced-code-tabs.svg"/> |
| 6 | + <img src="https://img.shields.io/pypi/l/markdown-fenced-code-tabs.svg"/> |
| 7 | +</p> |
5 | 8 |
|
6 | 9 | # Markdown Code Tabs Extension |
7 | 10 |
|
8 | | -Generates Bootstrap HTML Tabs for Consecutive Markdown Fenced Code Blocks |
9 | | - |
10 | | -```md |
11 | | - ```http |
12 | | - GET / HTTP/1.1 |
13 | | - User-Agent: MyClient/1.0.0 |
14 | | - Accept: application/vnd.travis-ci.2+json |
15 | | - Host: api.travis-ci.org |
16 | | - |
17 | | - HTTP/1.1 200 OK |
18 | | - Content-Type: application/json |
19 | | - |
20 | | - {"hello":"world"} |
21 | | - ``` |
22 | | - |
23 | | - ```shell |
24 | | - $ travis raw / |
25 | | - {"hello":"world"} |
26 | | - ``` |
27 | | - |
28 | | - ```ruby |
29 | | - require 'travis' |
30 | | - |
31 | | - # You usually don't want to fire API requests manually |
32 | | - client = Travis::Client.new |
33 | | - client.get_raw('/') # => {"hello"=>"world"} |
34 | | - |
35 | | - client.get('/repos/sinatra/sinatra') |
36 | | - # => {"repo"=>#<Travis::Client::Repository: sinatra/sinatra>} |
37 | | - ``` |
38 | | -``` |
39 | | - |
40 | | -Becomes: |
41 | | - |
42 | | - |
| 11 | +**Code Tabs** is an extension that generates a HTML structure for consecutive fenced code blocks content. |
43 | 12 |
|
44 | | -To customize the tab label, add the `fct_label` option to your code block. |
| 13 | +## Quick start |
45 | 14 |
|
46 | | -```md |
47 | | - ```swift fct_label="Swift 2" |
48 | | - array.enumerate() |
49 | | - ``` |
| 15 | +Installation is easy with pip: |
50 | 16 |
|
51 | | - ```swift fct_label="Swift 3" |
52 | | - array.enumerated() |
53 | | - ``` |
54 | | -``` |
55 | | - |
56 | | - |
57 | | - |
58 | | -## Installation |
59 | | - |
60 | | -Install the latest version with `pip`: |
61 | | -```sh |
| 17 | +``` sh |
62 | 18 | pip install markdown-fenced-code-tabs |
63 | | -``` |
64 | | - |
65 | | -## MkDocs Usage |
66 | | - |
67 | | -```yml |
68 | | -markdown_extensions: |
69 | | - - markdown_fenced_code_tabs: |
70 | | - single_block_as_tab: True |
71 | | -``` |
72 | | -
|
73 | | -## Options |
74 | | -
|
75 | | -### `single_block_as_tab` |
76 | | -If `True`, the extension will render a single code block as a tab. Default is `False`. |
77 | | - |
78 | | -`single_block_as_tab: True` generates: |
79 | | - |
80 | | - |
| 19 | +``` |
81 | 20 |
|
82 | | -`single_block_as_tab: False` generates: |
| 21 | +For detailed installation instructions and a demo, visit |
| 22 | +[the documentation](https://yacir.github.io/markdown-fenced-code-tabs/). |
83 | 23 |
|
84 | | - |
85 | 24 |
|
86 | 25 | ## Author |
87 | 26 | [Yassir Barchi](http://yassir.fr) |
|
0 commit comments