Skip to content

amorfatianima/obsidian-timeline-plugin

Repository files navigation

Timeline Tracker Plugin for Obsidian

A plugin for tracking and visualizing timeline events in Obsidian with advanced features.

中文版本 (Chinese Version)

Features

Core Features

  • Automatic extraction of timeline events from diary files
  • Display events in chronological order (newest first)
  • Support for custom event marker formats
  • Configurable diary folder path
  • Filtering and searching timeline events
  • Basic statistics with visible event count

Advanced Timeline Features

  • Beautiful Vertical Timeline Visualization:

    • Vertical timeline axis with nodes
    • Event cards with hover effects and shadows
    • Responsive design for different screen sizes
    • Loading and empty states for better user feedback
  • Enhanced Event Extraction:

    • Extract events from content under specific headers (like Dataview)
    • Support for customizable tag identifiers (## 时间线 or ## Timeline)
    • Extract content from specified header to next same or higher level header
    • Support for sub-headers and nested content structure
    • Only explicitly marked timeline events are displayed
    • No fallback to diary file first line content
  • Subheader Filtering:

    • Extract and display all subheaders from timeline events
    • Checkbox-based filtering by subheaders
    • Select/Deselect all subheaders with one click
    • Real-time filtering of timeline events based on selected subheaders
  • Smart Filtering Options:

    • Show Same Day Subheaders: When filtering by subheader, show all subheaders from the same day
    • Combined search and subheader filtering
    • Search results respect current subheader filter selections

Configuration Options

  • Diary Folder Path: Specify the folder containing your diary files (default: "日记")
  • Event Marker: Customize the text used to mark timeline events (default: "[时间线]")
  • Tag Identifier: Identifier used to extract tagged content (default: "时间线")
  • Show Same Day Subheaders: Toggle to control same-day subheader visibility during filtering

Real-time Updates

  • Automatic detection of new, modified, or deleted diary files
  • Instant timeline refresh when diary files change
  • No need to restart the plugin for updates

Installation

  1. Download the plugin files
  2. Place the plugin folder in your Obsidian vault's .obsidian/plugins directory
  3. Enable the plugin in Obsidian's settings

Development

Prerequisites

  • Node.js
  • npm

Building

  1. Install dependencies:

    npm install
    
  2. Build the plugin:

    npm run build
    
  3. For development with automatic rebuilding:

    npm run dev
    

Usage

Configuration

  1. Open Obsidian Settings
  2. Find "Timeline Tracker" plugin settings
  3. Configure the diary folder path (optional, default: "日记")
  4. Set the event marker (default is "[时间线]")
  5. Configure tag identifier (default is "时间线")
  6. Toggle "Show Same Day Subheaders" option

Adding Timeline Events

Method 1: Inline Event Markers

In your diary files, add timeline events using the following format:

- [时间线] Event description

Or use a custom event marker:

- [Timeline] Event description

Method 2: Tag-based Content Extraction

Create sections with specific headers to organize timeline events:

# 2023-08-25

Today is an important milestone.

## 时间线

### 本周完成工作
- 完成用户反馈分析
- 确定下一阶段开发计划

### 下周计划
- 准备项目演示材料
- 开始新功能开发

### 风险与问题
- 资源不足可能影响进度

Viewing the Timeline

  1. Open the command palette (Ctrl/Cmd + P)
  2. Run "Timeline Tracker: Open Timeline View"
  3. The timeline view will appear in the right sidebar

Using Filters

Subheader Filtering

  1. Use the checkboxes below the search box to filter by subheaders
  2. Click "全选/全不选" to toggle all subheaders
  3. Only events containing selected subheaders will be displayed

Search Filtering

  1. Type in the search box to filter events by content
  2. Search results will respect current subheader filter selections
  3. Clear the search box to return to subheader filtering

Show Same Day Subheaders

  1. When enabled, filtering by subheaders shows all subheaders from the same day
  2. When disabled, only the selected subheaders are displayed

Example

Here's an example of a diary file:

# 2023-06-15

Today I started a new project.

## 时间线

### 今日完成
- [时间线] Project kickoff meeting
- [时间线] Technology stack decision
- [时间线] Initial task assignment

### 明日计划
- [时间线] Set up development environment
- [时间线] Create project documentation

## Project Notes

This project is very important to our team.

Custom Configuration

You can customize the following options in the settings:

  1. Diary Folder Path: Specify the folder containing your diary files
  2. Event Marker: Customize the text used to mark timeline events
  3. Tag Identifier: Identifier used to extract tagged content (e.g., ## 时间线 or ## Timeline)
  4. Show Same Day Subheaders: When filtering by subheader, show all subheaders from the same day

File Structure

obsidian-timeline-plugin/
├── manifest.json          # Plugin metadata
├── main.js               # Compiled plugin code
├── styles.css            # Plugin styles
├── src/
│   ├── main.ts           # Main plugin logic
│   ├── view.ts           # Timeline view component
│   ├── settings.ts       # Settings tab
│   ├── data-fetcher.ts   # Data fetching logic
│   ├── constants.ts      # Plugin constants
│   └── types.d.ts        # Type definitions
├── package.json          # Dependencies and scripts
├── tsconfig.json         # TypeScript configuration
└── esbuild.config.mjs    # Build configuration

Contributing

Feel free to fork this repository and submit pull requests with improvements.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors