Skip to content

Commit 96bccad

Browse files
committed
Fix building docs
1 parent 652fe52 commit 96bccad

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.github/workflows/pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
with:
2121
persist-credentials: false
2222
- name: Set up Ruby
23-
uses: actions/setup-ruby@v1
23+
uses: ruby/setup-ruby@v1
2424
with:
25-
ruby-version: '2.7'
25+
ruby-version: '3.4'
2626
- name: Setup python
2727
uses: actions/setup-python@v1
2828
with:

_pages/main.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import re
2+
3+
BYEXMAPLE_PROMT_RE=re.compile(r"^(>>|\.\.|=>)( |$)", re.M)
4+
5+
def byexample_repl(matchobj):
6+
if matchobj.group(1) == '=>': return '#=> '
7+
else: return ''
8+
9+
def define_env(env):
10+
"""
11+
This is the hook for defining variables, macros and filters
12+
13+
- variables: the dictionary that contains the environment variables
14+
- macro: a decorator function, to declare a macro.
15+
"""
16+
17+
@env.filter
18+
def remove_code_promt(text):
19+
return BYEXMAPLE_PROMT_RE.sub(byexample_repl, text)

0 commit comments

Comments
 (0)