-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id,name,description,link | ||
programs,תכניות,תכניות רווחה פעילות,programs/ | ||
responses,מענים,מענים בתחום הרווחה,responses/ | ||
situations,מצבי חיים,מצבי חיים,situations/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
<!DOCTYPE html> | ||
<html lang="en" dir="rtl"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>.</title> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet"> | ||
<style type="text/css"> | ||
* { | ||
font-family: "Open Sans", sans-serif; | ||
font-optical-sizing: auto; | ||
} | ||
body { | ||
margin: 0; | ||
padding: 20px; | ||
direction: rtl; | ||
display: flex; | ||
flex-flow: column; | ||
align-items: center; | ||
} | ||
body > div { | ||
width: 100%; | ||
max-width: 800px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>דוגמא לפרסום טקסונומיה</h1> | ||
<p>מאגר קוד זה ידגים את האופן הרצוי בו אפשר לפרסם את הטקסונומיה המשרדית, בהתאם להגדרות המפורטות בקובץ ״מילון מושגי יסוד״.</p> | ||
<p>בדוגמה זו נראה פרסום של מספר טקסונומיות <strong>דמה</strong>:</p> | ||
<ul> | ||
<li><a href="situations/">טקסונומיית מצבי חיים</a></li> | ||
<li><a href="responses/">טקסונומיית מענים</a></li> | ||
<li><a href="programs/">טקסונומיית תכניות</a></li> | ||
</ul> | ||
<p>חשוב לשים לב שכלל המונחים פה הם מומצאים ואינם מיועדים לשימוש פומבי.</p> | ||
</div> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# דוגמא לפרסום טקסונומיה | ||
|
||
מאגר קוד זה ידגים את האופן הרצוי בו אפשר לפרסם את הטקסונומיה המשרדית, בהתאם להגדרות המפורטות בקובץ ״מילון מושגי יסוד״. | ||
|
||
בדוגמה זו נראה פרסום של מספר טקסונומיות **דמה**: | ||
|
||
- [טקסונומיית מצבי חיים](situations/) | ||
- [טקסונומיית מענים](responses/) | ||
- [טקסונומיית תכניות](programs/) | ||
|
||
חשוב לשים לב שכלל המונחים פה הם מומצאים ואינם מיועדים לשימוש פומבי. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import os | ||
import markdown | ||
|
||
def render_markdown_to_html(markdown_file): | ||
"""Convert markdown file content to HTML.""" | ||
with open(markdown_file, 'r', encoding='utf-8') as f: | ||
text = f.read() | ||
html_content = markdown.markdown(text) | ||
return html_content | ||
|
||
def create_index_html(directory, html_content): | ||
"""Create an index.html file in the directory with the HTML content and RTL direction.""" | ||
index_file = os.path.join(directory, 'index.html') | ||
|
||
# HTML template with RTL direction | ||
html_template = f""" | ||
<!DOCTYPE html> | ||
<html lang="en" dir="rtl"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{directory}</title> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet"> | ||
<style type="text/css"> | ||
* {{ | ||
font-family: "Open Sans", sans-serif; | ||
font-optical-sizing: auto; | ||
}} | ||
body {{ | ||
margin: 0; | ||
padding: 20px; | ||
direction: rtl; | ||
display: flex; | ||
flex-flow: column; | ||
align-items: center; | ||
}} | ||
body > div {{ | ||
width: 100%; | ||
max-width: 800px; | ||
}} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
{html_content} | ||
</div> | ||
</body> | ||
</html> | ||
""" | ||
|
||
with open(index_file, 'w', encoding='utf-8') as f: | ||
f.write(html_template) | ||
print(f"Created {index_file}") | ||
|
||
def traverse_directory(base_directory): | ||
"""Traverse the directory tree and create index.html files.""" | ||
for root, _, files in os.walk(base_directory): | ||
if 'readme.md' in files: | ||
markdown_file = os.path.join(root, 'readme.md') | ||
html_content = render_markdown_to_html(markdown_file) | ||
create_index_html(root, html_content) | ||
|
||
if __name__ == "__main__": | ||
base_directory = '.' # Replace with your directory | ||
traverse_directory(base_directory) |