Skip to content

Commit 6a0c0c6

Browse files
committed
fix: improve pandoc highlight style compatibility and add robust fallback for markdown conversion
1 parent 548951e commit 6a0c0c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+72
-53
lines changed

.github/workflows/docs.yml

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -491,60 +491,59 @@ jobs:
491491
<div class="container">
492492
EOF
493493
494-
# Convert markdown to beautiful HTML using pandoc
495-
if [ -f "mcp_rust_tutorial.md" ]; then
496-
echo "Converting tutorial markdown to beautiful HTML..."
497-
pandoc mcp_rust_tutorial.md \
498-
-f markdown+smart+pipe_tables+fenced_code_blocks+definition_lists \
499-
-t html5 \
500-
--standalone \
501-
--toc \
502-
--toc-depth=4 \
503-
--section-divs \
504-
--html-q-tags \
505-
--highlight-style=github \
506-
--template=target/doc/tutorials/template.html \
507-
-o target/doc/tutorials/mcp_rust_tutorial.html \
508-
--metadata title="MCP Rust Tutorial - Complete Learning Resource"
509-
510-
# Add closing tags
511-
echo '</div><div class="footer">🦀 <strong>MCP Rust Tutorial</strong> | Built with ❤️ for the Rust Community</div></body></html>' >> target/doc/tutorials/mcp_rust_tutorial.html
512-
513-
echo "✅ Beautiful tutorial HTML created successfully!"
514-
else
515-
echo "⚠️ Tutorial markdown not found, creating placeholder..."
516-
cat target/doc/tutorials/template.html > target/doc/tutorials/mcp_rust_tutorial.html
517-
echo '<h1>🚧 Tutorial Coming Soon</h1><p>The comprehensive MCP Rust tutorial will be available soon.</p></div></body></html>' >> target/doc/tutorials/mcp_rust_tutorial.html
518-
fi
494+
# Convert markdown to beautiful HTML using pandoc
495+
if [ -f "mcp_rust_tutorial.md" ]; then
496+
echo "Converting tutorial markdown to beautiful HTML..."
497+
498+
# Try pandoc with advanced features first
499+
if pandoc mcp_rust_tutorial.md \
500+
-f markdown+smart+pipe_tables+fenced_code_blocks+definition_lists \
501+
-t html5 \
502+
--standalone \
503+
--toc \
504+
--toc-depth=4 \
505+
--section-divs \
506+
--html-q-tags \
507+
--highlight-style=tango \
508+
--template=target/doc/tutorials/template.html \
509+
-o target/doc/tutorials/mcp_rust_tutorial.html \
510+
--metadata title="MCP Rust Tutorial - Complete Learning Resource" 2>/dev/null; then
511+
512+
# Add closing tags
513+
echo '</div><div class="footer">🦀 <strong>MCP Rust Tutorial</strong> | Built with ❤️ for the Rust Community</div></body></html>' >> target/doc/tutorials/mcp_rust_tutorial.html
514+
echo "✅ Beautiful tutorial HTML created successfully with pandoc!"
515+
516+
else
517+
echo "⚠️ Pandoc failed, trying simpler conversion..."
518+
# Fallback to basic pandoc conversion
519+
if pandoc mcp_rust_tutorial.md \
520+
-f markdown \
521+
-t html5 \
522+
--standalone \
523+
--toc \
524+
--template=target/doc/tutorials/template.html \
525+
-o target/doc/tutorials/mcp_rust_tutorial.html 2>/dev/null; then
526+
527+
echo '</div><div class="footer">🦀 <strong>MCP Rust Tutorial</strong> | Built with ❤️ for the Rust Community</div></body></html>' >> target/doc/tutorials/mcp_rust_tutorial.html
528+
echo "✅ Tutorial HTML created with basic pandoc conversion!"
529+
530+
else
531+
echo "⚠️ Pandoc conversion failed, creating manual HTML..."
532+
# Manual HTML creation as ultimate fallback
533+
cat target/doc/tutorials/template.html > target/doc/tutorials/mcp_rust_tutorial.html
534+
# Use a simple Python one-liner for markdown conversion
535+
python3 -c "import markdown; print(markdown.markdown(open('mcp_rust_tutorial.md').read(), extensions=['toc', 'codehilite', 'tables']))" >> target/doc/tutorials/mcp_rust_tutorial.html
536+
echo '</div><div class="footer">🦀 <strong>MCP Rust Tutorial</strong> | Built with ❤️ for the Rust Community</div></body></html>' >> target/doc/tutorials/mcp_rust_tutorial.html
537+
echo "✅ Tutorial HTML created with Python markdown!"
538+
fi
539+
fi
540+
else
541+
echo "⚠️ Tutorial markdown not found, creating placeholder..."
542+
cat target/doc/tutorials/template.html > target/doc/tutorials/mcp_rust_tutorial.html
543+
echo '<h1>🚧 Tutorial Coming Soon</h1><p>The comprehensive MCP Rust tutorial will be available soon.</p></div></body></html>' >> target/doc/tutorials/mcp_rust_tutorial.html
544+
fi
519545
520-
# Create a CSS file for tutorials
521-
cat > target/doc/tutorials/tutorial-style.css << 'EOF'
522-
/* Additional styles for tutorial content */
523-
.tutorial-content {
524-
max-width: none;
525-
}
526-
.highlight {
527-
background-color: #fff3cd;
528-
border: 1px solid #ffeaa7;
529-
border-radius: 4px;
530-
padding: 15px;
531-
margin: 20px 0;
532-
}
533-
.note {
534-
background-color: #d4edda;
535-
border: 1px solid #c3e6cb;
536-
border-radius: 4px;
537-
padding: 15px;
538-
margin: 20px 0;
539-
}
540-
.warning {
541-
background-color: #f8d7da;
542-
border: 1px solid #f1b2b7;
543-
border-radius: 4px;
544-
padding: 15px;
545-
margin: 20px 0;
546-
}
547-
EOF
546+
548547
549548
# Step 5.6: Create additional navigation and utility pages
550549
- name: Create site navigation and utilities

mcp-rust-examples-linux-x64.tar.gz

27.3 MB
Binary file not shown.
3.78 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_01_hello_world: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_01_hello_world.rs
3.79 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_02_calculator: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_02_calculator.rs
3.72 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_03_text_processor: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_03_text_processor.rs
3.73 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_04_simple_client: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_04_simple_client.rs
3.77 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_05_resource_provider: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_05_resource_provider.rs
3.82 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_06_configurable_server: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_06_configurable_server.rs
4.07 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_07_file_operations: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_07_file_operations.rs
7.25 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_08_http_client: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_08_http_client.rs

release-binaries/example_09_database

7.05 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_09_database: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_09_database.rs

release-binaries/example_10_streaming

4.01 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_10_streaming: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_10_streaming.rs
3.9 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_11_monitoring: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_11_monitoring.rs
3.74 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_12_task_queue: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_12_task_queue.rs
3.86 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_13_auth_service: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_13_auth_service.rs
3.86 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_14_notification_service: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_14_notification_service.rs
3.65 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_15_data_pipeline: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_15_data_pipeline.rs
3.65 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_16_search_service: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_16_search_service.rs
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_17_blockchain_integration: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_17_blockchain_integration.rs
3.63 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_18_ml_model_server: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_18_ml_model_server.rs
3.66 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_19_microservice_gateway: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_19_microservice_gateway.rs
3.93 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/target/x86_64-unknown-linux-gnu/release/example_20_enterprise_server: /Users/hamzeghalebi/projects/learning/rust/llms/mcps/tutorial/src/examples/example_20_enterprise_server.rs

release-binaries/mcp_rust_examples

432 KB
Binary file not shown.

0 commit comments

Comments
 (0)