Added headers
This commit is contained in:
parent
d130fa5831
commit
e81d2c938b
57 changed files with 361 additions and 56 deletions
|
|
@ -25,13 +25,15 @@ created: 2026-04-21
|
|||
---
|
||||
```
|
||||
|
||||
This includes:
|
||||
|
||||
Obsidian calls these metadata variables 'Properties'. These include:
|
||||
|
||||
- Key–value pairs
|
||||
- Lists (arrays)
|
||||
- Booleans, numbers, strings, dates
|
||||
- Nested objects
|
||||
|
||||
|
||||
### Obsidian-specific limitations & quirks
|
||||
|
||||
Although it’s YAML, Obsidian does **not support the full YAML spec equally everywhere**:
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
- All notes in this Obsidian vault need metadata.
|
||||
- These metadata need to follow the [Obsidian Front Matter Syntax](Obsidian%20Front%20Matter%20Syntax.md).
|
||||
- Obsidian calls metadata key-value pairs 'Properties'
|
||||
- Obsidian calls metadata variables 'Properties'
|
||||
- In this Corpus we use General properties (every note should have them) and Specific properties (depending on the kind of note, can be inferred from other properties)
|
||||
|
||||
## General metadata
|
||||
|
|
@ -31,57 +31,3 @@ For the language property we use the language code as defined in ISO 639-1.
|
|||
- Specific properties for ISO 27002 OST notes are deduced from chapter 4 of the standard ("Themes and Attributes"). They are: `theme`, `control_type`, `information_security_properties`, `cybersecurity_concepts`, `operational_capabilities`, and `security_domains`.
|
||||
- For the possible values of these properties, see [ISO 27002 Themes and Attributes](ISO%2027002%20Themes%20and%20Attributes.md).
|
||||
|
||||
|
||||
## Phases for ISMS implementation
|
||||
|
||||
|
||||
|
||||
# Enrichment Prompt Examples
|
||||
|
||||
## Adding front matter to original ISO clauses and controls
|
||||
|
||||
- We are going to add front matter to the files in folder iso27diy-corp/Corpus/Standards/ISO27x/OST/27002/EN.
|
||||
- To do this, you will need access to this folder and its contents. Check that you have access, and if not, stop the process immediately and get into contact with the user to fix the problem.
|
||||
- You also need to be able to read the [Original Standard Text](../iso27diy-corp/Corpus/Standards/ISO27x/OST/27002/EN/ISO%2027002_2022_EN.docx). If you cannot access or read this document, stop the process immediately and get into contact with the user to fix the problem.
|
||||
- See [_Corpus-metadata](../iso27diy-corp/Corpus/_Corpus-metadata.md) for instructions on adding metadata.
|
||||
- Each note in this folder (with a few exceptions) represents an ISO 27002 Control.
|
||||
- Additionally to what is described in the Corpus Metadata note, each control will get metadata fields according to [ISO 27002 Themes and Attributes](ISO%2027002%20Themes%20and%20Attributes.md) - note can be found in the Content Factory folder.
|
||||
|
||||
Additionally, you will add the following metadata key-value pairs:
|
||||
```YAML
|
||||
notetype: sourcetext
|
||||
standard: ISO 27002
|
||||
version: 2022
|
||||
language: EN
|
||||
type: control
|
||||
id: A.<x.yy>
|
||||
title: <control title>
|
||||
```
|
||||
|
||||
- The `<x.yy>` part of the `id` and the `<control title>` can often be found in the content of the markdown note as a level 2 header.
|
||||
- THIS IS MOST IMPORTANT: Do not make up or infer any of these themes, attributes and values. If you cannot extract them from the note itself, refer to the Original Standard Text.
|
||||
- When you cannot extract the information from the note itself, or from the Original Standard Text, mark the note with the tag REVIEW.
|
||||
|
||||
## Adding more front matter
|
||||
We are now going to work on files in iso27diy-corp/Corpus/Standards/ISO27x/OST/27001/NL/
|
||||
|
||||
Write a simple program or script to add properly formatted YAML front matter (for Obsidian) to the markdown files in the iso27diy-corp/Corpus/Standards/ISO27x/OST/27001/NL/ directory.
|
||||
|
||||
Here is an example for c-6.3-Planning-van-wijzigingen.md:
|
||||
```
|
||||
notetype: reference
|
||||
standard: ISO 27001
|
||||
version: 2023
|
||||
language: NL
|
||||
type: clause
|
||||
id: "C.6.3"
|
||||
title: "Planning van wijzigingen"
|
||||
tags:
|
||||
- iso27001/2023/EN
|
||||
- sourcetext
|
||||
status: active
|
||||
```
|
||||
|
||||
`id` and `title` are specific to the file, the other kv-pairs are the same for all files.
|
||||
|
||||
Do a test run to see if your program has the intended effect. Check back with the user if you encounter exceptions.
|
||||
|
|
|
|||
33
process_md_files.py
Normal file
33
process_md_files.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env python3
|
||||
import os
|
||||
import glob
|
||||
|
||||
# Directory containing the .md files
|
||||
directory = 'Corpus/Standards/ISO27x/PECB-Lead-Auditor-Training/transcriptions'
|
||||
|
||||
# Find all .md files in the directory
|
||||
md_files = glob.glob(os.path.join(directory, '*.md'))
|
||||
|
||||
for file_path in md_files:
|
||||
# Get the filename without extension
|
||||
filename = os.path.basename(file_path)
|
||||
name_without_ext = os.path.splitext(filename)[0]
|
||||
|
||||
# Replace dashes with spaces
|
||||
header_text = name_without_ext.replace('-', ' ')
|
||||
|
||||
# Create the header block
|
||||
header = f'# {header_text}\n\n## Abstract\n\n## Transcription\n\n'
|
||||
|
||||
# Read the existing content
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# Prepend the header
|
||||
new_content = header + content
|
||||
|
||||
# Write back to the file
|
||||
with open(file_path, 'w', encoding='utf-8') as f:
|
||||
f.write(new_content)
|
||||
|
||||
print("Processed all .md files.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue