Skip to content

Improve tutorial1 #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dependencies/gromacstutorials-inputs
1 change: 1 addition & 0 deletions .dependencies/pyplot-perso
Submodule pyplot-perso added at 0cedb1
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule ".dependencies/gromacstutorials-inputs"]
path = .dependencies/gromacstutorials-inputs
url = [email protected]:gromacstutorials/gromacstutorials-inputs.git
branch = main
[submodule ".dependencies/pyplot-perso"]
path = .dependencies/pyplot-perso
url = [email protected]:simongravelle/pyplot-perso.git
branch = LAMMPS-livecom
53 changes: 53 additions & 0 deletions docs/sphinx/compile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import subprocess
import re

# Define ANSI escape codes for colors
RED = '\033[91m'
GREEN = '\033[92m'
GRAY = '\033[90m'
RESET = '\033[0m'

def filter_make_output():

# Define multiple patterns to ignore
ignore_patterns = [
"Pygments lexer name 'bw' is not known",
"Pygments lexer name 'lammps' is not known",
".. label:: start_",
".. label:: end_",
"Unknown directive type"
]

# Define a pattern to identify warnings (example pattern, adjust as needed)
warning_pattern = re.compile('|'.join(re.escape(p) for p in ["WARNING:", "ERROR:"]))

# Combine ignore patterns into a single regex pattern
ignore_pattern = re.compile('|'.join(re.escape(p) for p in ignore_patterns))

# Run 'make clean'
subprocess.run(['make', 'clean'], check=True)

# Run 'make html' and capture output
process = subprocess.Popen(['make', 'html'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, text=True)

# Read and filter output
output_lines = []
for line in process.stdout:
if len(line) > 1:
if not ignore_pattern.search(line):
# Determine the color based on whether the line matches the warning pattern
if warning_pattern.search(line):
output_lines.append(RED + line + RESET)
else:
output_lines.append(GRAY + line + RESET)

# Wait for the process to complete
process.wait()

# Print the filtered output
print(''.join(output_lines), end='')

if __name__ == "__main__":
filter_make_output()
20 changes: 20 additions & 0 deletions docs/sphinx/source/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
mask-image: var(--icon--info);
}

/* New non-title information admonition */
.admonition.non-title-info > .admonition-title {
display: none; /* Hide the title */
}

.admonition.non-title-info {
background-color: #2962ff10;
border-color: #2963ff;
font-size: 13pt;
}

.admonition.non-title-info > .admonition-content {
color: #4b2d83; /* Purple text color for contrast */
}

.admonition.non-title-info > .admonition-title::before {
content: ''; /* No icon needed, as there's no title */
}


:root { /*https://fontawesomeicons.com/svg/icons/info*/
--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>')
}
Expand Down
Loading