Skip to content

Commit

Permalink
Merge pull request #3 from terwer/dev
Browse files Browse the repository at this point in the history
feat: 代码块美化第一个版本完成
  • Loading branch information
terwer committed Jun 4, 2023
2 parents c5c5864 + 55b3767 commit 749d511
Show file tree
Hide file tree
Showing 16 changed files with 2,524 additions and 142 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/ci.yml

This file was deleted.

76 changes: 1 addition & 75 deletions .github/workflows/release-please.yml
Expand Up @@ -26,78 +26,4 @@ jobs:
## header used within the release PR body, defaults to using :robot: I have created a release *beep* *boop*
pull-request-header: ':robot: A new release will be created'
## A JSON formatted String containing to override the outputted changelog sections
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"refactor","section":"Code Refactoring","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"perf","section":"Performance Improvements","hidden":false}]'

# Checkout
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v3

# Install Node.js
- name: Install Node.js
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

# Install pnpm
- name: Install pnpm
if: ${{ steps.release.outputs.release_created }}
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false

# Get pnpm store directory
- name: Get pnpm store directory
if: ${{ steps.release.outputs.release_created }}
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
# Setup pnpm cache
- name: Setup pnpm cache
if: ${{ steps.release.outputs.release_created }}
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# Install dependencies
- name: Install dependencies
if: ${{ steps.release.outputs.release_created }}
run: pnpm install

# Prepare new version
# https://github.com/google-github-actions/release-please-action#outputs
- name: Prepare new version
if: ${{ steps.release.outputs.release_created }}
run: |
pnpm prepareRelease
# Build for production
- name: Build for production
if: ${{ steps.release.outputs.release_created }}
run: pnpm build

# Archive package
- name: Archive package
if: ${{ steps.release.outputs.release_created }}
run: pnpm package

# Upload package to release
# https://github.com/philips-labs/terraform-aws-github-runner/blob/main/.github/workflows/release.yml#L46
- name: Upload package.zip to the release
if: ${{ steps.release.outputs.releases_created }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
ls -l ./build
for f in $(find ./build -name '*.zip'); do
gh release upload ${{ steps.release.outputs.tag_name }} $f
done
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"refactor","section":"Code Refactoring","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"perf","section":"Performance Improvements","hidden":false}]'
1 change: 0 additions & 1 deletion .gitignore
@@ -1,7 +1,6 @@
.idea
.vscode
.DS_Store
pnpm-lock.yaml
package.zip
node_modules
dev
Expand Down
18 changes: 3 additions & 15 deletions README.md
Expand Up @@ -8,23 +8,11 @@ Imitate the Mac-style code block style, and specially adapt to popular themes su

## FAQ

* Q1: What is the origin of this plugin?
* Q1: How to use? Need an action button?

A1: Refer to [Automatically add pinyin as aliases to new files](https://github.com/siyuan-note/siyuan/issues/8396). If the alias is automatically generated, after the alias search is enabled, the efficiency can be greatly improved. Because, you think, typing an English character or pinyin must be faster than Chinese characters, right?
A1: This plugin has no operation buttons. After downloading and enabling the plugin, open the document, and the code block will be automatically beautified into Mac style. Gone.

* Q2: Can it be automatically generated when creating a new document?

A2: Yes. v0.0.3 supports automatic generation when renaming the title. Of course, you can also click the button on the top bar to generate.

* Q3: Why can't the automatically generated key be changed?

A3: This is for compatibility with subsequent publishing tools, and this key is actually only concerned by developers. Ordinary users have no obvious perception, it is just a convention. Of course, if there is a strong demand for changes, subsequent versions may also consider supporting custom named keys. Note: The key of non-custom attribute cannot be modified.

* Q4: How to enable alias search?

A4: Go to `Settings` -> `Search`, you can find the switch to enable alias search, you can choose naming, alias and custom attributes.

![](./assets/slug-setting.png)
If you don't want to use this plugin, you can directly use [Zhihu Theme](https://github.com/terwer/siyuan-theme-zhihu) or dig out the [Code Block](https://github.com/terwer/siyuan-theme-zhihu/tree/main/style/theme/code-block) related css.

## Donate

Expand Down
26 changes: 26 additions & 0 deletions README_zh_CN.md
Expand Up @@ -6,6 +6,32 @@

模仿Mac风格的代码块风格,并且对Rem Craft、Savor、Dark+、HBuilderX等热门主题进行专门适配

## 效果展示

### Zhihu

备注:这个代码块样式就是从我的 [Zhihu主题](https://github.com/terwer/siyuan-theme-zhihu) 抠出来的。[手动狗头]

您可以卸载此插件,直接使用 Zhihu主题,当然,您也可以使用此插件,用以下经过适配的主题。PS:默认主题也支持。

![](./assets/zhihu.png)

### Rem Craft

![](./assets/rem-craft.png)

## Savor

![](./assets/savor.png)

### Dark+

![](./assets/dark-plus.png)

### HBuilderX-Light

![](./assets/hbx.png)

## FAQ

* Q1:怎么使用?需要操作按钮吗?
Expand Down
Binary file added assets/dark-plus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/hbx.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rem-craft.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/savor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/zhihu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 749d511

Please sign in to comment.