onlyafly / number-headings-obsidian

Automatically number headings in a document in Obsidian
MIT License
104 stars 11 forks source link

Bugfix issue#29 #30

Closed zhao414 closed 2 years ago

zhao414 commented 2 years ago

Hi, this pull request tries to solve issue#29 and improves/modifies the numbering policy as shown as the following examples (please notice the changes in the yaml)

without numbering:

# h1
## h1-2
### h1-2-1
## h1-3
### h1-3-1
### h1-3-2

# h2
## h2-1
### h2-1-1
### h2-1-2
## h2-2

Example 1:

---
number headings: auto, first-level 1, max 6, _.1.1.
---
# h1
## 1.1. h1-2
### 1.1.1. h1-2-1
## 1.2. h1-3
### 1.2.1. h1-3-1
### 1.2.2. h1-3-2

# h2
## 2.1. h2-1
### 2.1.1. h2-1-1
### 2.1.2. h2-1-2
## 2.2. h2-2

Example 2:

---
number headings: auto, first-level 1, max 6, 1.1.
---
# 1. h1
## 1.1. h1-2
### 1.1.1. h1-2-1
## 1.2. h1-3
### 1.2.1. h1-3-1
### 1.2.2. h1-3-2

# 2. h2
## 2.1. h2-1
### 2.1.1. h2-1-1
### 2.1.2. h2-1-2
## 2.2. h2-2

Example 3:

---
number headings: auto, first-level 3, max 6, _.1.1.
---
# h1
## h1-2
### 1. h1-2-1
## h1-3
### 1. h1-3-1
### 2. h1-3-2

# h2
## h2-1
### 1. h2-1-1
### 2. h2-1-2
## h2-2

Example 4:

---
number headings: auto, first-level 3, max 6, _.1.1.
aliases:   
---
# h1
## h1-2
### 1. h1-2-1
## h1-3
### 1. h1-3-1
### 2. h1-3-2

# h2
## h2-1
### 1. h2-1-1
### 2. h2-1-2
## h2-2

(Example 3 and Example 4 look the same)