Skip to content

Commit 0a5b1a0

Browse files
committed
docs: update Readme & Template Reference
1 parent ea5154d commit 0a5b1a0

6 files changed

Lines changed: 133 additions & 9 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: npm
44
directory: "/"
55
schedule:
6-
interval: monthly
6+
interval: weekly
77
open-pull-requests-limit: 10
88
labels:
99
- Dependencies

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,32 @@
22

33
An Obsidian plugin that integrates with GitHub to track issues and pull requests directly in your vault.
44

5-
The configurations are heavily inspired by https://github.com/schaier-io, including some specific settings. However, I had already started working on my prototype before I discovered the plugin, and had initially even given it a similar name.
5+
6+
>The configurations are heavily inspired by https://github.com/schaier-io, including some specific settings. However, I had already started working on my prototype before I discovered the plugin, and had initially even given it a similar name.
67
78
## ✨ Features
89

9-
- Track issues and pull requests from specific GitHub repositories
10-
- Automatically sync GitHub data on Obsidian startup (configurable)
11-
- Filter tracked items by assignee and reviewers
12-
- Create Markdown notes for each issue or pull request
10+
### 🔄 Issue & Pull Request Tracking
11+
- Track issues and pull requests from multiple GitHub repositories
12+
- Automatically sync GitHub data on startup (configurable)
13+
- Background sync at configurable intervals
14+
- Filter by labels, assignees, and reviewers
15+
- Include or exclude closed issues/PRs
16+
- Automatic cleanup of old closed items
17+
18+
### 📊 GitHub Projects v2 Integration
19+
- Track GitHub Projects across repositories
20+
- Kanban board view for project visualization
21+
- Custom field support (status, priority, iteration)
22+
- Project-specific filtering and organization
23+
24+
### 📝 Markdown Notes
25+
- Create markdown notes for each issue or PR
26+
- Customizable filename templates with variables
27+
- Custom content templates
28+
- YAML frontmatter with metadata
29+
- Preserve user content with persist blocks
30+
- Include comments in notes
1331

1432
## 🚀 Installation
1533

@@ -43,6 +61,9 @@ The configurations are heavily inspired by https://github.com/schaier-io, includ
4361
3. Click **Add Repository** or **Add Selected Repositories**
4462
4. The plugin will automatically fetch issues from the configured repositories
4563

64+
### ⭐ This repository if you like this project!
65+
66+
4667
## 📄 License
4768

4869
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

src/util/templateUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ function escapeRegExp(string: string): string {
323323
*/
324324
function processConditionalBlocks(template: string, data: TemplateData): string {
325325
// Pattern: {variableName:content} - show content only if variableName has a value
326-
const conditionalPattern = /\{(\w+):(.*?)\}/g;
326+
// This pattern supports nested variables like {project:{project_url}}
327+
const conditionalPattern = /\{(\w+):([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g;
327328

328329
return template.replace(conditionalPattern, (match, variableName, content) => {
329330
// Check if the variable exists and has a meaningful value

templates/Template Variables Reference.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,51 @@
6868
| `{lockReason}` | Reason for locking | "resolved", "spam", "off-topic" |
6969
| `{comments}` | Formatted comments section | Complete comments with formatting |
7070

71+
## GitHub Projects
72+
73+
These variables are available when the issue/PR is part of a GitHub Project (Projects V2).
74+
75+
### Basic Project Information
76+
77+
| Variable | Description | Example |
78+
|----------|-------------|---------|
79+
| `{project}` | Project title (first project if in multiple) | "Sprint Board" |
80+
| `{project_url}` | Project URL | "https://github.com/orgs/owner/projects/1" |
81+
| `{project_number}` | Project number | "1" |
82+
| `{project_status}` | Status field value | "In Progress", "Done" |
83+
| `{project_priority}` | Priority field value | "High", "Medium", "Low" |
84+
85+
### Iteration Information
86+
87+
| Variable | Description | Example |
88+
|----------|-------------|---------|
89+
| `{project_iteration}` | Current iteration title | "Sprint 5" |
90+
| `{project_iteration_start}` | Iteration start date | "2025-01-15" |
91+
| `{project_iteration_duration}` | Iteration duration in days | "14" |
92+
93+
### Multiple Projects
94+
95+
| Variable | Description | Example |
96+
|----------|-------------|---------|
97+
| `{projects}` | All project names as comma-separated list | "Sprint Board, Backlog" |
98+
| `{projects_yaml}` | All project names as YAML array | `["Sprint Board", "Backlog"]` |
99+
100+
### Custom Fields
101+
102+
| Variable | Description | Example |
103+
|----------|-------------|---------|
104+
| `{project_fields}` | All custom fields as YAML | ` Effort: "5"` (with newlines) |
105+
| `{project_field:FieldName}` | Access specific custom field by name | `{project_field:Effort}` → "5" |
106+
71107
## Conditional Blocks
72108

73109
| Syntax | Description | Example |
74110
|--------|-------------|---------|
75-
| `{variable:content}` | Shows content only if variable has a value | `Milestone: {milestone}}` |
111+
| `{variable:content}` | Shows content only if variable has a value | `{milestone:Milestone: {milestone}}` |
112+
113+
### Project-related Conditionals
114+
115+
| Syntax | Description |
116+
|--------|-------------|
117+
| `{project:content}` | Shows content only if item is in a project |
118+
| `{projects:content}` | Shows content if item is in any project |

templates/detailed-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ allowDelete: true
4545

4646
---
4747

48-
*Auto-generated from GitHub {type} data*
48+
*Last updated: {updated}*

templates/project-template.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: "{title_yaml}"
3+
number: {number}
4+
status: "{status}"
5+
type: "{type}"
6+
repository: "{repository}"
7+
created: "{created}"
8+
author: "{author}"
9+
assignees: {assignees_yaml}
10+
labels: {labels_yaml}
11+
project: "{project}"
12+
project_status: "{project_status}"
13+
project_priority: "{project_priority}"
14+
project_iteration: "{project_iteration}"
15+
updateMode: "none"
16+
allowDelete: true
17+
---
18+
19+
# {title}
20+
21+
**{type} #{number}** in **{repository}**
22+
23+
{project:## Project
24+
25+
| Field | Value |
26+
|-------|-------|
27+
| **Project** | [{project}]({project_url}) |
28+
| **Status** | {project_status} |
29+
| **Priority** | {project_priority} |
30+
| **Iteration** | {project_iteration} |
31+
}
32+
## Summary
33+
34+
{body}
35+
36+
## People
37+
38+
- **Author:** @{author}
39+
- **Assignees:** {assignees}
40+
41+
## Classification
42+
43+
- **Status:** `{status}`
44+
- **Labels:** {labels}
45+
- **Milestone:** {milestone}
46+
## Dates
47+
48+
- **Created:** {created}
49+
- **Updated:** {updated}
50+
- **Closed:** {closed}
51+
## Links
52+
53+
[View on GitHub]({url}){project: | [View in Project]({project_url})}
54+
55+
{comments}
56+
57+
---
58+
59+
*Last updated: {updated}*

0 commit comments

Comments
 (0)