Skip to content

Commit 9fa2ce7

Browse files
author
vyleung
committed
RELEASE: v.1.0.0
initial release
0 parents  commit 9fa2ce7

12 files changed

Lines changed: 4447 additions & 0 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/publish.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build plugin
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
8+
9+
env:
10+
PLUGIN_NAME: logseq-copy-code-plugin
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: '16.x' # You might need to adjust this value to your own version
22+
- name: Build
23+
id: build
24+
run: |
25+
npm i && npm run build
26+
mkdir ${{ env.PLUGIN_NAME }}
27+
cp README.md package.json icon.png ${{ env.PLUGIN_NAME }}
28+
mv dist ${{ env.PLUGIN_NAME }}
29+
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
30+
ls
31+
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
32+
- name: Create Release
33+
uses: ncipollo/release-action@v1
34+
id: create_release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
VERSION: ${{ github.ref }}
38+
with:
39+
allowUpdates: true
40+
draft: false
41+
prerelease: false
42+
43+
- name: Upload zip file
44+
id: upload_zip
45+
uses: actions/upload-release-asset@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
asset_path: ./${{ env.PLUGIN_NAME }}.zip
51+
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
52+
asset_content_type: application/zip
53+
54+
- name: Upload package.json
55+
id: upload_metadata
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
asset_path: ./package.json
62+
asset_name: package.json
63+
asset_content_type: application/json

.gitignore

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
.DS_Store
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
lerna-debug.log*
9+
.pnpm-debug.log*
10+
11+
# Diagnostic reports (https://nodejs.org/api/report.html)
12+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
13+
14+
# Runtime data
15+
pids
16+
*.pid
17+
*.seed
18+
*.pid.lock
19+
20+
# Directory for instrumented libs generated by jscoverage/JSCover
21+
lib-cov
22+
23+
# Coverage directory used by tools like istanbul
24+
coverage
25+
*.lcov
26+
27+
# nyc test coverage
28+
.nyc_output
29+
30+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
31+
.grunt
32+
33+
# Bower dependency directory (https://bower.io/)
34+
bower_components
35+
36+
# node-waf configuration
37+
.lock-wscript
38+
39+
# Compiled binary addons (https://nodejs.org/api/addons.html)
40+
build/Release
41+
42+
# Dependency directories
43+
node_modules/
44+
jspm_packages/
45+
46+
# Snowpack dependency directory (https://snowpack.dev/)
47+
web_modules/
48+
49+
# TypeScript cache
50+
*.tsbuildinfo
51+
52+
# Optional npm cache directory
53+
.npm
54+
55+
# Optional eslint cache
56+
.eslintcache
57+
58+
# Microbundle cache
59+
.rpt2_cache/
60+
.rts2_cache_cjs/
61+
.rts2_cache_es/
62+
.rts2_cache_umd/
63+
64+
# Optional REPL history
65+
.node_repl_history
66+
67+
# Output of 'npm pack'
68+
*.tgz
69+
70+
# Yarn Integrity file
71+
.yarn-integrity
72+
73+
# dotenv environment variables file
74+
.env
75+
.env.test
76+
.env.production
77+
78+
# parcel-bundler cache (https://parceljs.org/)
79+
.cache
80+
.parcel-cache
81+
82+
# Next.js build output
83+
.next
84+
out
85+
86+
# Nuxt.js build / generate output
87+
.nuxt
88+
dist
89+
90+
# Gatsby files
91+
.cache/
92+
# Comment in the public line in if your project uses Gatsby and not Next.js
93+
# https://nextjs.org/blog/next-9-1#public-directory-support
94+
# public
95+
96+
# vuepress build output
97+
.vuepress/dist
98+
99+
# Serverless directories
100+
.serverless/
101+
102+
# FuseBox cache
103+
.fusebox/
104+
105+
# DynamoDB Local files
106+
.dynamodb/
107+
108+
# TernJS port file
109+
.tern-port
110+
111+
# Stores VSCode versions used for testing VSCode extensions
112+
.vscode-test
113+
.vscode
114+
115+
# yarn v2
116+
.yarn/cache
117+
.yarn/unplugged
118+
.yarn/build-state.yml
119+
.yarn/install-state.gz
120+
.pnp.*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 vyleung
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## logseq-copy-code-plugin
2+
> If you find this plugin – or any of my other [Logseq plugins](https://github.com/vyleung?tab=repositories&q=logseq&type=source) – useful and would like to support me, you can [buy me a coffee](https://www.buymeacoffee.com/vyleung) 🙂
3+
4+
🚨 **NOTE:** Your Logseq version must be 0.6.7+ to run this plugin
5+
6+
## Features
7+
### Copy code from code blocks
8+
- The position of the copy code icon can be configured in the [settings](#settings)
9+
- The copy code button may disappear if you edit the code block directly rather than in the Code Mirror editor. To get the button to re-appear, you can a new block underneath the code block – OR — toggle the collapse state of any block
10+
#### Demo
11+
![logseq-copy-code-plugin main demo](screenshots/logseq_copy_code_main_demo.gif)
12+
13+
## Installation
14+
### Preparation
15+
1. Click the 3 dots in the righthand corner → `Settings``Advanced` → Enable `Developer mode` and `Plug-in system`
16+
2. Click the 3 dots in the righthand corner → `Plugins` – OR – Use keyboard shortcut `Esc t p`
17+
18+
### Load plugin via the marketplace (not available yet)
19+
20+
### Load plugin manually
21+
1. Download the [latest release](https://github.com/vyleung/logseq-copy-code-plugin/releases) of the plugin (e.g logseq-copy-code-plugin-v.1.0.0.zip) from Github
22+
2. Unzip the file
23+
3. Navigate to plugins (Click the 3 dots → `Plugins` – OR – Use keyboard shortcut `Esc t p`) → `Load unpacked plugin` → Select the folder of the unzipped file
24+
25+
#### Settings
26+
- Each time you make changes to the plugin settings, please reload the plugin to ensure that all settings are updated
27+
![logseq-copy-code-plugin settings](screenshots/logseq_copy_code_settings.png)
28+
29+
## License
30+
MIT
31+
32+
## Credits
33+
- Plugin Marketplace Icon: <a href="https://www.flaticon.com/free-icons/seo-and-web" title="seo and web icons">SEO and web icons created by kerismaker - Flaticon</a>
34+
- Plugin concept inspired by the [Obsidian Code Block Copy plugin](https://github.com/jdbrice/obsidian-code-block-copy)

icon.png

7.74 KB
Loading

0 commit comments

Comments
 (0)