code blocks with backticks for more control on formatting

This commit is contained in:
2026-03-08 15:32:46 +05:30
parent f73282b997
commit e8e16f3996
3 changed files with 65 additions and 63 deletions

View File

@@ -160,6 +160,7 @@ Example:
## Example formatting ## Example formatting
- Use indentation for examples. - Use indentation for examples.
- Indent section contents using four spaces.
- Use code blocks for example code. - Use code blocks for example code.
Example: Example:
@@ -177,16 +178,16 @@ Example:
Example: Example:
Create foo: Create foo:
```python ```python
foo = Foo("example") foo = Foo("example")
``` ```
Run engine: Run engine:
```python ```python
engine = BarEngine([foo]) engine = BarEngine([foo])
engine.run() engine.run()
``` ```
Avoid fenced code blocks inside structured sections. Avoid fenced code blocks inside structured sections.
@@ -335,10 +336,10 @@ Example:
Example: Example:
Create and inspect a Foo: Create and inspect a Foo:
```python ```python
foo = Foo("example", value=42) foo = Foo("example", value=42)
print(foo.name) print(foo.name)
``` ```
''' '''
``` ```
@@ -361,13 +362,13 @@ Example:
Example: Example:
Run engine: Run engine:
```python ```python
foo1 = Foo("a") foo1 = Foo("a")
foo2 = Foo("b") foo2 = Foo("b")
engine = BarEngine([foo1, foo2]) engine = BarEngine([foo1, foo2])
engine.run() engine.run()
``` ```
''' '''
``` ```
@@ -417,12 +418,12 @@ Example:
Example: Example:
Process foo: Process foo:
```python ```python
foo = Foo("example", value=10) foo = Foo("example", value=10)
result = process(foo, multiplier=2) result = process(foo, multiplier=2)
print(result) print(result)
``` ```
''' '''
``` ```
@@ -447,19 +448,19 @@ Example:
Example: Example:
Basic usage: Basic usage:
```python ```python
foo1 = Foo("a") foo1 = Foo("a")
foo2 = Foo("b") foo2 = Foo("b")
combined = combine(foo1, foo2) combined = combine(foo1, foo2)
``` ```
Pipeline usage: Pipeline usage:
```python ```python
engine = BarEngine([foo1, foo2]) engine = BarEngine([foo1, foo2])
engine.run() engine.run()
``` ```
''' '''
``` ```

View File

@@ -159,6 +159,7 @@ Example:
## Example formatting ## Example formatting
- Use indentation for examples. - Use indentation for examples.
- Indent section contents using four spaces.
- Use code blocks for example code. - Use code blocks for example code.
Example: Example:
@@ -176,16 +177,16 @@ Example:
Example: Example:
Create foo: Create foo:
```python ```python
foo = Foo("example") foo = Foo("example")
``` ```
Run engine: Run engine:
```python ```python
engine = BarEngine([foo]) engine = BarEngine([foo])
engine.run() engine.run()
``` ```
Avoid fenced code blocks inside structured sections. Avoid fenced code blocks inside structured sections.
@@ -334,10 +335,10 @@ Example:
Example: Example:
Create and inspect a Foo: Create and inspect a Foo:
```python ```python
foo = Foo("example", value=42) foo = Foo("example", value=42)
print(foo.name) print(foo.name)
``` ```
''' '''
``` ```
@@ -360,13 +361,13 @@ Example:
Example: Example:
Run engine: Run engine:
```python ```python
foo1 = Foo("a") foo1 = Foo("a")
foo2 = Foo("b") foo2 = Foo("b")
engine = BarEngine([foo1, foo2]) engine = BarEngine([foo1, foo2])
engine.run() engine.run()
``` ```
''' '''
``` ```
@@ -416,12 +417,12 @@ Example:
Example: Example:
Process foo: Process foo:
```python ```python
foo = Foo("example", value=10) foo = Foo("example", value=10)
result = process(foo, multiplier=2) result = process(foo, multiplier=2)
print(result) print(result)
``` ```
''' '''
``` ```
@@ -446,19 +447,19 @@ Example:
Example: Example:
Basic usage: Basic usage:
```python ```python
foo1 = Foo("a") foo1 = Foo("a")
foo2 = Foo("b") foo2 = Foo("b")
combined = combine(foo1, foo2) combined = combine(foo1, foo2)
``` ```
Pipeline usage: Pipeline usage:
```python ```python
engine = BarEngine([foo1, foo2]) engine = BarEngine([foo1, foo2])
engine.run() engine.run()
``` ```
''' '''
``` ```

File diff suppressed because one or more lines are too long