Skip to content

Commit

Permalink
Add documents
Browse files Browse the repository at this point in the history
  • Loading branch information
cuigh committed Mar 29, 2022
0 parents commit c343506
Show file tree
Hide file tree
Showing 12 changed files with 320 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.obsidian
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[English](https://github.com/cuigh/obelisk) | [中文](https://github.com/cuigh/obelisk/blob/master/README_zh.md)

Obelisk is a publishing tool for markdown document library, which can help you generate HTML documents simply and quickly. In particular, out of personal preference, Obelisk has made a lot of optimization for the [Obsidian](https://obsidian.md) document library, which can be used as an alternative to the official publishing service.

## Features

- Compatible with CommonMark, GFM Extensions etc
- Support custom themes
- Support document search
- Support back links
- Support some mainstream plugins of the Obsidian community
- Excalidraw
- Banner
- Admonition
- Icon Folder
- ……

## Screenshots

**Document**
![Document](docs/assets/document.png)

**Graph**
![Graph](docs/assets/graph.png)

**Extensions**
![Extensions](docs/assets/extension.png)

## Getting Started

Please follow the [Documentation](https://cuigh.com/obelisk).

## Roadmap

- [x] CommonMark
- [x] GFM Extensions
- [x] Callout
- [x] LaTeX
- [x] Comment
- [ ] Embed
- [x] Image
- [x] Audio
- [x] Video
- [x] Excalidraw
- [x] PDF
- [ ] Markdown
- [x] Plugin
- [x] Banner
- [x] Excalidraw
- [x] Admonition
- [x] Icon Folder
- [x] Theme
- [x] Search
- [x] Back links
54 changes: 54 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[English](https://github.com/cuigh/obelisk) | [中文](https://github.com/cuigh/obelisk/blob/master/README_zh.md)

Obelisk 是一个 Markdown 文档库发布工具,它能够简单、快速的帮你生成 HTML 文档。特别的,出于个人的偏爱,Obelisk 针对 [Obsidian](https://obsidian.md) 文档库做了大量的优化,可作为官方发布服务的一个替代方案。

## 主要特性

- 兼容 Markdown 标准规范及常用扩展规范
- 支持自定义主题
- 支持文档搜索
- 支持反向链接
- 支持 Obsidian 社区的一些主流插件
- Excalidraw
- Banner
- Admonition
- Icon Folder
- ……

## 屏幕截图

**文档**
![Document](docs/assets/document.png)

**图谱**
![Graph](docs/assets/graph.png)

**扩展**
![Extensions](docs/assets/extension.png)

## 快速上手

请参考这里的 [使用文档](https://cuigh.com/obelisk)

## 路线图

- [x] CommonMark
- [x] GFM Extensions
- [x] Callout
- [x] LaTeX
- [x] Comment
- [ ] Embed
- [x] Image
- [x] Audio
- [x] Video
- [x] Excalidraw
- [x] PDF
- [ ] Markdown
- [x] Plugin
- [x] Banner
- [x] Excalidraw
- [x] Admonition
- [x] Icon Folder
- [x] Theme
- [x] Search
- [x] Back links
34 changes: 34 additions & 0 deletions docs/00 Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
obelisk_toc: false
slug: index
banner: "assets/banner.png"
banner_y: 0.46586
---

# Obelisk

Obelisk 是一个 Markdown 文档库发布工具,它能够简单、快速的帮你生成 HTML 文档。特别的,出于个人的偏爱,Obelisk 针对 [Obsidian](https://obsidian.md) 文档库做了大量的优化,可作为官方发布服务的一个替代方案。

## 主要特性

- 兼容 Markdown 标准规范及常用扩展规范
- 支持自定义主题
- 支持文档搜索
- 支持反向链接
- 支持 Obsidian 社区的一些主流插件
- Excalidraw
- Banner
- Admonition
- Icon Folder
- ……

## 屏幕截图

**Document**
![[document.png]]

**Graph**
![[graph.png]]

**Extensions**
![[extension.png]]
56 changes: 56 additions & 0 deletions docs/01 Quick Start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 快速上手

## 下载

你可以从这里下载最新版本的 [Obelisk](https://github.com/cuigh/obelisk/releases)

## 使用

下载 Obelisk 并把它解压到系统 PATH 目录后,就可以通过下面的命令把 Markdown 文档仓库生成静态 HTML 页面。

```shell
obelisk build -v /folder/to/vault -o /folder/to/output
```

build 命令的完整参数见下表。

| 参数 | 说明 |
| --------- | ---------------------------------------------------- |
| v, vault | document vault path, required |
| t, theme | internal theme name or external theme path, optional |
| o, output | output path, required |
| h, help | show help |

如果你希望设置生成页面的样式,你可以参考 [[02 Theme]] 章节。

## 约定

为简化使用,Obelisk 遵循约定高于配置的原则。

### 导航排序

默认情况下,导航菜单以文件名进行排序,但这很可能不是你想要的。当文件或文件夹的名称以数字开头时,Obelisk 会自动提取数字作为顺序号,然后用升序进行排序,所有不以数字开头的文件名的序号都默认为 999。在提取顺序号之后,Obelisk 还会贴心的把顺序号从标题中移除,以便让导航菜单和 URL 看起来更舒服。示例如下:

| 源文件名 | 目标文件名 |
| ------------------- | ------------------ |
| 00 Home.md | home.html |
| 01 Reading notes.md | reading-notes.html |

### URL

默认情况下,Obelisk 会按照 Kebe 方式对文件和文件夹名称进行转换,比如 Test Aaa 会转换成 test-aaa。除此之外,你也可以通过其它方式来指定页面 URL。

- 通过在文档 metadata 中添加 slug 属性
- 在仓库配置文件中添加路径映射。注意路径映射只

### Favicon

### Logo

### Ignore Path

你可能希望在发布时隐藏文档库的部分目录或文件,比如未完工的草稿文件夹或附件文件夹。Obelisk 支持忽略指定的文件夹,这些目录下的文件将不会作为文档输出成 HTML 页面,也不会出现在导航菜单中(但不会影响其它页面对它作为资源文件的引用)。如果你不对文档库进行配置,Obelisk 默认会忽略如下目录:

- assets
- templates
- attachments
67 changes: 67 additions & 0 deletions docs/02 Theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 主题

Obelisk 充分理解大家的个性化需求,故从一开始就添加了对主题的支持。

## 内置主题

目前 Obelisk 内置了 Willow 和 Coco 两款主题 (鉴于作者毕竟不是专业的设计师且时间有限,如果觉得页面样式不合口味也请多多包涵)。使用内置主题只需要把主题名称传递给 theme 参数即可,如下所示:

```shell
obelisk build -v /folder/to/vault -o /folder/to/output -t willow
```

Obelisk 内置的主题都放在 [GitHub](http://github.com/cuigh/obelisk) 上,你可以通过提交 PR 来完善它们或添加新的主题,Obelisk 每次发布新版会同步更新内置主题。

## 自定义主题

除了使用 Obelisk 内置的主题外,你也可以使用外部主题。Obelisk 的主题是一个包含页面模版、样式、脚本等资源的文件夹,典型的主题目录结构如下。

```
├── assets
│   ├── css
│   │   └── app.css
│   └── js
│   └── app.js
├── templates
│   └── page.html
└── theme.yml
```

只有 `templates/page.html``theme.yml` 是必须的,其中后者是主题的配置文件,包含主题名称、作者等配置信息。

```yaml
name: Willow
author: cuigh
url: github.com/cuigh/obelisk
assets:
- assets
```
| 属性 | 说明 |
| ------ | ---------------- |
| name | 主题名称 |
| author | 主题作者 |
| url | 主题的网址 |
| assets | 要复制的资源文件 |
使用自定义主题跟使用内置主题没有太大的差别,只需要把主题文件夹的路径作为主题参数即可,如下所示
```shell
obelisk build -v /folder/to/vault -o /folder/to/output -t /folder/to/theme
```

> [!TIP]
> 如果你打算创建你自己的主题,在内置主题的基础上进行修改不失为一个便捷的方案。
## 模版

Obelisk 是使用 Go 语言开发的,其主题中的页面模版也采用了 Go 的 HTML 模版语法,你可以在访问 [html/template](https://pkg.go.dev/html/template) 页面了解语法规则。

### 内置函数

除了 Go 模版内置的函数之外,Obelisk 还添加了如下函数以方便模版的编写。

| Function | Description |
| -------- | ------------------------------------ |
| wrap | wrap a value with context |
| url | convert relative url to corrent path |
Binary file added docs/assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/document.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions docs/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/obelisk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: Obelisk
url: https://github.com/cuigh/obelisk
lang: en
copyright: "© 2021-2022 cuigh. All rights reserved."
ignores:
- assets

0 comments on commit c343506

Please sign in to comment.