Skip to content

Commit 55d4fe1

Browse files
committed
inital init
1 parent 814b9e5 commit 55d4fe1

8 files changed

Lines changed: 145 additions & 156 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
directory: ./src
1818
output: ./dist
19-
js_engine: uglify-js
19+
css_engine: lightning
2020

2121
- name: auto commit the minified files
2222
uses: stefanzweifel/git-auto-commit-action@v5

README.md

Lines changed: 24 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,45 @@
11
# Better Embed
22

3-
A docsify.js plugin to embed selective areas from another markdown file.
3+
A [docsify.js](https://github.com/docsifyjs/docsify) plugin to simplify the color selection for [docsify-themable](https://github.com/jhildenbiddle/docsify-themeable).
44

5-
## Installation
5+
## Installation and usage instructions
66

7-
How to install this plugin.
7+
> [!NOTE]
8+
> Sorry for not providing a demo, but I thought this is a very self explanatory setup. But I am using this activly in [another projects](https://github.com/Karlo-Hosting/Docs/blob/a42df71978a439923162b411b2efb589df0a8e22/_css/colors-dark.css#L1).
9+
10+
How to install this plugin:
11+
12+
1. Make sure you have [docsify-themable](https://github.com/jhildenbiddle/docsify-themeable) installed.
13+
2. Copy one of the stylesheet segments from below and copy it into the `head` section your `index.html` file. Make sure that is is after all other plugins and before your own modifications.
14+
3. Copy the example-files from [the source directory](https://github.com/FlippedCodes/docsify-simple-themable/tree/main/src) into your projects `_css/` folder.
15+
4. Rename them into `colors-dark.css` and `colors-light.css`
16+
5. Change the colors in those files to your liking.
817

918
### Production
1019

1120
For production, please use the numbered version to prevent breaking changes in production.
1221

1322
``` html
14-
<script src="https://unpkg.com/docsify-betterembed@1.1.1/dist/betterEmbed.min.js"></script>
23+
<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="./_css/colors-dark.css">
24+
<link rel="stylesheet" media="(prefers-color-scheme: light)" href="./_css/colors-light.css">
25+
<link rel="stylesheet" href="https://unpkg.com/docsify-simple-themable@1.0.0/dist/main.min.css">
1526
```
1627

1728
### Development
1829

1930
If you are developing on a doc, you can use the latest. Make sure you switch it to production later, or the production one right away.
2031

2132
``` html
22-
<script src="https://unpkg.com/docsify-betterembed@latest/dist/betterEmbed.min.js"></script>
33+
<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="./_css/colors-dark.css">
34+
<link rel="stylesheet" media="(prefers-color-scheme: light)" href="./_css/colors-light.css">
35+
<link rel="stylesheet" href="https://unpkg.com/docsify-simple-themable@latest/dist/main.min.css">
2336
```
2437

25-
## Usage
26-
27-
> [!NOTE]
28-
> Sorry for not providing a demo, but I thought this is a very self explanatory setup. But I am using this activly in [another projects](https://github.com/FlippedCodes/Unofficial-Resonite-Docs/blob/c92cd4baf050c3316924b4af71ec59b9defaef66/gameplay/botCommands.md?plain=1#L78).
29-
30-
### Basic instructions
31-
32-
1. Surround the part you want *to embed* in the following comment:
33-
34-
``` markdown
35-
<!-- embed:start:exampleName -->
36-
37-
YOUR CONTENT HERE
38-
39-
<!-- embed:end:exampleName -->
40-
```
41-
42-
> [!IMPORTANT]
43-
> Make sure you respect the spaces between the comments and your content. It can mess with the html (specifically tables), if they are left out.
44-
45-
2. Embed the content like this:
46-
47-
``` markdown
48-
[Some Name](path/to/markdown/file/with/embed.md#exampleName ':include')
49-
```
50-
51-
--> The link will then be replaced with the content.
52-
If it doesn't the selector, it will embed the whole page. Aka, you might have done something wrong.
53-
54-
### Tips
55-
56-
- Setup 2 just converts to a different text, you can also use this to keep the link for Markdown, vanilla-feeling:
57-
58-
``` markdown
59-
<!-- embedImport:start:exampleName -->
60-
[Some Name](path/to/markdown/file/with/embed.md ':include')
61-
<!-- embedImport:end:exampleName -->
62-
```
63-
64-
- Because the selector is what decides the beginning and the end, you can nest and overlay the embed selections, however you like it.
65-
66-
``` markdown
67-
<!-- embed:start:expl3 -->
68-
<!-- embed:start:expl1 -->
69-
70-
Very original stuff.
71-
72-
<!-- embed:start:expl2 -->
73-
74-
Oh, So much content
75-
76-
<!-- embed:end:expl1 -->
77-
78-
uhm.. hows your day?
38+
## Tips
7939

80-
<!-- embed:end:expl2 -->
81-
<!-- embed:end:expl3 -->
82-
```
40+
- This project is inspired by the color pallet naming scheme of [daisyUI](https://daisyui.com/): You can use their [theme generator](https://daisyui.com/theme-generator/) to select colors.
41+
- If you think something on your docs should have a different color. You are more then welcome to copy the `src/main.css` into your `_css` folder as well. Just make sure you don't forget to adjust hte link in in the `head` section of your `index.html`!
42+
- If you already have a css files, you are free to change the folder location in the stylesheet references in `index.html`.
8343

8444
## Contributing
8545

@@ -89,15 +49,12 @@ I'm always happy, if someone has improvements to this little plugin. If you want
8949

9050
Nothing much here, but I'm planning to add the following features at some point:
9151

92-
- [ ] Support for [docsify-mustache](https://docsify-mustache.github.io) so Docsify can have proper templating.
93-
- [ ] Being able to use header as a selector and not use comments to mark the start and end.
94-
- [ ] Offset header levels to either fit the current layout, or being able to select it.
95-
- [ ] Rewrite links to point at their embeded version (eg. Youtube)
52+
- [ ] Remove requirement for docsify-themable.
9653

9754
## License
9855

9956
This repo is using the [MIT license](LICENSE).
10057

10158
## Credit
10259

103-
Thanks to the [docsify.js](https://docsify.js.org/#/) team to make writing plugins so simple. I usually don't front end, but this was a breeze to get working.
60+
Thanks to the [docsify.js](https://docsify.js.org/#/) team to make changing CSS so simple. I usually don't front end, but this was a breeze to get working.

dist/betterEmbed.min.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
2-
"name": "docsify-betterembed",
3-
"version": "1.1.1",
4-
"description": "A docsify.js plugin to embed selective areas from another markdown file.",
5-
"main": "src/betterEmbed.js",
2+
"name": "docsify-simple-themable",
3+
"version": "1.0.0",
4+
"description": "A docsify.js plugin to simplify the color selection for docsify-themable.",
65
"repository": {
76
"type": "git",
8-
"url": "git+https://github.com/FlippedCodes/docsify-betterembed.git"
7+
"url": "git+https://github.com/FlippedCodes/docsify-simple-themable.git"
98
},
109
"keywords": [
1110
"docsify",
1211
"docsify.js",
1312
"plugin",
14-
"embed",
15-
"better embed"
13+
"simple themable",
14+
"themable"
1615
],
1716
"author": "phil",
1817
"license": "MIT"

src/betterEmbed.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/example-dark.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:root {
2+
--primary: oklch(65.69% 0.196 275.75);
3+
--secondary: oklch(74.8% 0.26 342.55);
4+
--accent: oklch(74.51% 0.167 183.61);
5+
--neutral: #2a323c;
6+
--neutral-content: #A6ADBB;
7+
--base-100: #1d232a;
8+
--base-200: #191e24;
9+
--base-300: #15191e;
10+
--base-content: #A6ADBB;
11+
--info: #17a2b8;
12+
--success: #28a745;
13+
--warning: #f0ad4e;
14+
--error: #dc3545;
15+
}

src/example-light.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:root {
2+
--primary: #66cc8a;
3+
--secondary: #377cfb;
4+
--accent: #f68067;
5+
--neutral: #333c4d;
6+
--neutral-content: #f9fafb;
7+
--base-100: oklch(100% 0 0);
8+
--base-200: #f9fafb;
9+
--base-300: #e3ecf8;
10+
--base-content: #333c4d;
11+
--info: #17a2b8;
12+
--success: #28a745;
13+
--warning: #f0ad4e;
14+
--error: #dc3545;
15+
}
16+

src/main.css

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
:root {
2+
/* app */
3+
--theme-color: var(--primary);
4+
5+
/* base */
6+
--base-background-color: var(--base-100);
7+
--base-color: var(--base-content);
8+
9+
--mark-background: var(--warning);
10+
--mark-color: var(--neutral);
11+
12+
--selection-color: var(--primary);
13+
14+
/* content */
15+
--blockquote-border-color: var(--accent);
16+
--blockquote-color: var(--base-content);
17+
18+
--code-theme-text: var(--base-content);
19+
20+
--heading-color: var(--base-content);
21+
--heading-h2-border-color: var(--neutral);
22+
23+
--table-shadow-color: var(--base-200); /* custom var */
24+
--table-body-border-color: var(--base-300);
25+
--table-head-border-color: var(--base-300);
26+
--table-body-border-width: 2px;
27+
--table-head-border-width: 2px;
28+
--table-head-background: var(--base-300);
29+
--table-row-even-background: var(--base-200);
30+
--table-row-odd-background: var(--base-100);
31+
32+
--notice-background: var(--base-300);
33+
--notice-shadow-color: var(--base-200); /* custom var */
34+
35+
--link-color: var(--primary);
36+
--link-text-decoration: unset;
37+
--link-text-decoration--hover: underline;
38+
39+
/* Not possible: see fixes.css ln30ff */
40+
--notice-note-border-color: var(--info);
41+
--notice-note-color: var(--info);
42+
--notice-tip-border-color: var(--success);
43+
--notice-tip-color: var(--success);
44+
--notice-important-border-color: var(--secondary); /* renamed due to funni coloring of "tip" notice texts */
45+
--notice-important-color: var(--secondary); /* renamed due to funni coloring of "tip" notice texts */
46+
--notice-warning-border-color: var(--warning);
47+
--notice-warning-color: var(--warning);
48+
--notice-attention-border-color: var(--error);
49+
--notice-attention-color: var(--error);
50+
51+
/* Sidebar */
52+
53+
--sidebar-background: var(--base-300);
54+
--sidebar-toggle-background: var(--base-300);
55+
--sidebar-border-color: transparent;
56+
--sidebar-width: 19rem;
57+
--sidebar-shadow-color: var(--base-200); /* custom var */
58+
59+
--sidebar-nav-pagelink-padding: 0px;
60+
--sidebar-nav-pagelink-background: transparent;
61+
--sidebar-nav-pagelink-background--loaded: unset;
62+
--sidebar-nav-pagelink-background--active: unset;
63+
64+
/* Search */
65+
66+
--search-input-background-color: var(--base-200);
67+
--search-result-keyword-background: var(--primary);
68+
--search-input-border-width: unset;
69+
--search-clear-icon-color1: var(--neutral);
70+
--search-clear-icon-color2: var(--primary);
71+
72+
/* Zoom Image */
73+
74+
/* shadow color is also used for codeblocks */
75+
--zoomimage-shadow-color: var(--base-200); /* custom var */
76+
77+
/* ToC */
78+
--toc-side-indicator: var(--neutral);
79+
--toc-side-indicator-active: var(--primary);
80+
--toc-mobile-background: var(--base-200);
81+
--toc-shadow-color: var(--base-200);
82+
}
83+

0 commit comments

Comments
 (0)