Skip to content

Commit ff0e3a9

Browse files
authoredApr 19, 2025··
Merge pull request #23 from gromacstutorials/improved-tutorial1
Improve tutorial1
2 parents 407f7d9 + 6a57d00 commit ff0e3a9

40 files changed

+10668
-1157
lines changed
 

‎.dependencies/gromacstutorials-inputs

Submodule gromacstutorials-inputs added at a08da28

‎.dependencies/pyplot-perso

Submodule pyplot-perso added at 0cedb1c

‎.gitmodules

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[submodule ".dependencies/gromacstutorials-inputs"]
2+
path = .dependencies/gromacstutorials-inputs
3+
url = git@github.com:gromacstutorials/gromacstutorials-inputs.git
4+
branch = main
5+
[submodule ".dependencies/pyplot-perso"]
6+
path = .dependencies/pyplot-perso
7+
url = git@github.com:simongravelle/pyplot-perso.git
8+
branch = LAMMPS-livecom

‎docs/sphinx/compile.py

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import subprocess
2+
import re
3+
4+
# Define ANSI escape codes for colors
5+
RED = '\033[91m'
6+
GREEN = '\033[92m'
7+
GRAY = '\033[90m'
8+
RESET = '\033[0m'
9+
10+
def filter_make_output():
11+
12+
# Define multiple patterns to ignore
13+
ignore_patterns = [
14+
"Pygments lexer name 'bw' is not known",
15+
"Pygments lexer name 'lammps' is not known",
16+
".. label:: start_",
17+
".. label:: end_",
18+
"Unknown directive type"
19+
]
20+
21+
# Define a pattern to identify warnings (example pattern, adjust as needed)
22+
warning_pattern = re.compile('|'.join(re.escape(p) for p in ["WARNING:", "ERROR:"]))
23+
24+
# Combine ignore patterns into a single regex pattern
25+
ignore_pattern = re.compile('|'.join(re.escape(p) for p in ignore_patterns))
26+
27+
# Run 'make clean'
28+
subprocess.run(['make', 'clean'], check=True)
29+
30+
# Run 'make html' and capture output
31+
process = subprocess.Popen(['make', 'html'],
32+
stdout=subprocess.PIPE,
33+
stderr=subprocess.STDOUT, text=True)
34+
35+
# Read and filter output
36+
output_lines = []
37+
for line in process.stdout:
38+
if len(line) > 1:
39+
if not ignore_pattern.search(line):
40+
# Determine the color based on whether the line matches the warning pattern
41+
if warning_pattern.search(line):
42+
output_lines.append(RED + line + RESET)
43+
else:
44+
output_lines.append(GRAY + line + RESET)
45+
46+
# Wait for the process to complete
47+
process.wait()
48+
49+
# Print the filtered output
50+
print(''.join(output_lines), end='')
51+
52+
if __name__ == "__main__":
53+
filter_make_output()

‎docs/sphinx/source/_static/custom.css

+20
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@
3636
mask-image: var(--icon--info);
3737
}
3838

39+
/* New non-title information admonition */
40+
.admonition.non-title-info > .admonition-title {
41+
display: none; /* Hide the title */
42+
}
43+
44+
.admonition.non-title-info {
45+
background-color: #2962ff10;
46+
border-color: #2963ff;
47+
font-size: 13pt;
48+
}
49+
50+
.admonition.non-title-info > .admonition-content {
51+
color: #4b2d83; /* Purple text color for contrast */
52+
}
53+
54+
.admonition.non-title-info > .admonition-title::before {
55+
content: ''; /* No icon needed, as there's no title */
56+
}
57+
58+
3959
:root { /*https://fontawesomeicons.com/svg/icons/info*/
4060
--icon--patreon: url('data:image/svg+xml;charset=utf-8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <g> <path fill="none" d="M0 0h24v24H0z"/> <path d="M15 17a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15zM2 2h4v20H2V2z"/> </g> </svg>')
4161
}

0 commit comments

Comments
 (0)
Please sign in to comment.