Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@

# --- General Settings ---

# vault folder, relative to the perlite folder (default: Demo)
NOTES_PATH=Demo
# path to your vault / notes (default: Demo vault)
# - Docker: host path, relative to the docker-compose file or absolute, e.g. ./perlite/Demo or /srv/obsidian/MyVault
# docker compose mounts it into the container, nothing to change in the compose file
# - No Docker: the vault has to be inside the perlite folder, e.g. Demo or ./perlite/Demo
NOTES_PATH=./perlite/Demo
# vault name shown in the UI (default: folder name of the vault, "Notes" with Docker)
VAULT_NAME=Demo
# start page, without .md (default: README)
HOME_FILE=README
# browser tab title (default: Perlite)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ perlite/Demo/.obsidian/workspace.json
perlite/logo2.svg
Thumbs.db
perlite-dev
perlite/Notes
_Notes
perlite/.scripts/vendor
perlite/.scripts/release.sh
Expand Down
13 changes: 11 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
## 1.6.3
- Set Mermaid default htmlLabels to false
- Fixed browser printing (printed only a blank page), only the current note is printed now, code highlighting is kept
- new user setting `Print colors` (Perlite settings, stored in the browser): print the light variant of the active theme (default), as on screen or black & white
- **Docker:** the vault path is now only set via `NOTES_PATH` in the `.env` (host path, e.g. `./perlite/Demo` or `/srv/obsidian/MyVault`), the compose files mount it themselves, no need to change the volumes anymore. Existing `.env` files with `NOTES_PATH=Demo` have to be changed to `NOTES_PATH=./perlite/Demo` (or your vault path)
- without Docker, `NOTES_PATH` can also be given relative to the `.env` file (e.g. `./perlite/Demo`), so the same `.env` works for both setups
- new setting `VAULT_NAME` for the vault name shown in the UI (default: folder name of the vault)


## 1.6.2
- Support default (Gitlab / Github) Markdown Images
- Fixed broken links in tables, merged PR [#184](https://github.com/secure-77/Perlite/pull/184) thanks to @Nick-LCY
- Fixed Intended Fence Code Block rendering
- implemented support for Footnotes [#9](https://github.com/secure-77/Perlite/issues/9)
- Fixed internal default Markdown Links
- Extended YAML Frontmatter support
- Fixed callouts with no content [[#182](https://github.com/secure-77/Perlite/issues/182)]
- Fixed callouts with no content [#182](https://github.com/secure-77/Perlite/issues/182)
- updated katex to 0.18.9
- updated highlight.js to 11.12.0
- updated mermaid to 11.15.0
- updated vis-network to 10.1.2
- all settings are now configured in a single `.env` file (see `.env.example`), used by docker compose and read directly by helper.php without docker, `settings.php` has been removed
- new setting `TREE_VISIBLE_EXTENSIONS` to show other files (e.g. `pdf,docx`) next to the notes in the navigation, clicking them downloads the file [[#181](https://github.com/secure-77/Perlite/issues/181)]
- new setting `TREE_VISIBLE_EXTENSIONS` to show other files (e.g. `pdf,docx`) next to the notes in the navigation, clicking them downloads the file [#181](https://github.com/secure-77/Perlite/issues/181)
- read-only support for Obsidian Canvas (`.canvas`) files: text, note (embedded), image, link and group cards, edges with labels and colors, pan & zoom (drag / wheel, ctrl + wheel or pinch to zoom), the right side-dock is collapsed while a canvas is open
- canvas embeds: video and audio files are played inline, YouTube / Vimeo links are embedded, new setting `CANVAS_IFRAME_EMBEDS` (`off`, `click`, `auto`, default `click`) to embed websites of link cards as sandboxed iframe

Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,26 @@ If you want to discuss Perlite you can join the [Perlite Discord Server](https:/
- Search
- Obsidian tags, links, images and preview Support
- Dark and Light Mode
- Obsidian Canvas support


## Install
Please make sure you read the [required settings](https://github.com/secure-77/Perlite/wiki/03---Perlite-Settings#required-settings) first!
Please make sure you read the [required Obsidian settings](perlite/Demo/Documentation/05-Obsidian-Settings.md) first!

You can download the latest release from github or git clone the project and use docker.

- For non Docker please check [Setup](https://github.com/secure-77/Perlite/wiki/01---Setup-(no-Docker))
- For Docker, please check [Docker Setup](https://github.com/secure-77/Perlite/wiki/02---Setup-Docker)
- For Docker, please check [Docker Setup](perlite/Demo/Documentation/01-Docker-Setup.md)
- For non Docker please check [Setup without Docker](perlite/Demo/Documentation/02-Setup-without-Docker.md)


## Wiki
Please check the [wiki](https://github.com/secure-77/Perlite/wiki), here you will find further information, for example:
## Documentation
Please check the [documentation](perlite/Demo/Documentation/00-Index.md), here you will find further information, for example:

- [Themes](https://github.com/secure-77/Perlite/wiki/Themes)
- [Graph Setup and Settings](https://github.com/secure-77/Perlite/wiki/Graph)
- [Perlite Settings](https://github.com/secure-77/Perlite/wiki/03---Perlite-Settings)
- [Troubleshooting](https://github.com/secure-77/Perlite/wiki/Troubleshooting)
- [.env Settings](perlite/Demo/Documentation/03-Env-Settings.md)
- [Browser Settings](perlite/Demo/Documentation/04-Browser-Settings.md)
- [Graph Setup](perlite/Demo/Documentation/06-Graph.md)
- [Themes](perlite/Demo/Documentation/07-Themes.md)
- [Troubleshooting & FAQ](perlite/Demo/Documentation/08-Troubleshooting-FAQ.md)


## Security
Expand Down
4 changes: 3 additions & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ services:
- path: .env
required: false
volumes:
- ./perlite/Demo:/var/www/perlite/Demo:ro
- ${NOTES_PATH:-./perlite/Demo}:/var/www/perlite/Notes:ro
environment:
NOTES_PATH: Notes

web:
image: nginx:stable
Expand Down
6 changes: 4 additions & 2 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ services:
required: false
volumes:
- ./perlite:/var/www/perlite
- ./perlite/Demo:/var/www/perlite/Demo:ro
- ${NOTES_PATH:-./perlite/Demo}:/var/www/perlite/Notes:ro
environment:
NOTES_PATH: Notes

web:
image: nginx:stable
Expand All @@ -17,7 +19,7 @@ services:
volumes:
- ./web/config/perlite.conf:/etc/nginx/conf.d/default.conf:ro
- ./perlite:/var/www/perlite
- ./perlite/Demo:/var/www/perlite/Demo:ro
- ${NOTES_PATH:-./perlite/Demo}:/var/www/perlite/Notes:ro
depends_on:
- perlite

4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ services:
- path: .env
required: false
volumes:
- ./perlite/Demo:/var/www/perlite/Demo:ro
- ${NOTES_PATH:-./perlite/Demo}:/var/www/perlite/Notes:ro
environment:
NOTES_PATH: Notes

web:
image: nginx:stable
Expand Down
41 changes: 39 additions & 2 deletions perlite/.js/perlite.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,9 @@ function getContent(str, home = false, popHover = false, anchor = "") {
}

//render mermaid
mermaid.init(undefined, document.querySelectorAll(".language-mermaid"));
mermaid.run({
querySelector: ".language-mermaid"
});

// canvas pan & zoom
initCanvas();
Expand Down Expand Up @@ -1503,6 +1505,9 @@ $(document).ready(function () {
$('.darkModeOption').removeClass('is-enabled')
}

// print colors
$('#printModeDropdown').val(localStorage.getItem('printMode') || 'light')

// popUp Setting
if (localStorage.getItem('popUpEnabled') === 'true') {
$('.popUpSetting').addClass('is-enabled')
Expand Down Expand Up @@ -1861,6 +1866,33 @@ $(document).ready(function () {

});

// change print colors
$("#printModeDropdown").change(function (e) {
localStorage.setItem('printMode', $(e.target).val());
});

// apply print colors, the light variant of the active theme is used for "light" and "bw"
var printSwappedTheme = false;

window.addEventListener('beforeprint', function () {
var printMode = localStorage.getItem('printMode') || 'light';
$('body').addClass('perlite-print-' + printMode);

if (printMode !== 'screen' && $('body').hasClass('theme-dark')) {
$('body').removeClass('theme-dark').addClass('theme-light');
printSwappedTheme = true;
}
});

window.addEventListener('afterprint', function () {
$('body').removeClass('perlite-print-light perlite-print-screen perlite-print-bw');

if (printSwappedTheme) {
$('body').removeClass('theme-light').addClass('theme-dark');
printSwappedTheme = false;
}
});

//set active theme
if (localStorage.getItem('Theme')) {
$('#themeDropdown').val(localStorage.getItem('Theme'));
Expand Down Expand Up @@ -2396,7 +2428,12 @@ $(document).ready(function () {


// init mermaid
mermaid.initialize({ startOnLoad: false, 'securityLevel': 'Strict', 'theme': 'dark' });
mermaid.initialize({
startOnLoad: false,
securityLevel: 'Strict',
htmlLabels: false,
theme: 'dark'
});


// handle browser history
Expand Down
1 change: 0 additions & 1 deletion perlite/.js/

This file was deleted.

145 changes: 145 additions & 0 deletions perlite/.styles/perlite.css
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,148 @@ a.perlite-download-link:hover {
padding: var(--size-4-4);
color: var(--text-muted);
}


/* --------------- */
/* Print */
/* app.css (obsidian) hides the whole app while printing, because obsidian prints a cloned .print element.
Perlite prints the current note directly, the color mode is set by the user setting "Print colors" (perlite.js) */

@media print {

@page {
margin: 15mm;
}

body > .app-container {
display: block !important;
}

/* hide the ui, only the note is printed */
.titlebar,
.status-bar,
.workspace-ribbon,
.workspace-split.mod-left-split,
.workspace-split.mod-right-split,
.view-header,
.workspace-tab-header-container,
#graph_content,
.graph-controls,
.modal-container,
.popover,
.copy-code-button,
.copy-icon,
.sidebar-toggle-button,
.markdown-preview-pusher,
.workspace-leaf-resize-handle {
display: none !important;
}

/* let the note flow over multiple pages */
html,
body,
.app-container,
.horizontal-main-container,
.workspace,
.workspace-split.mod-vertical.mod-root,
.workspace-tabs,
.workspace-tab-container,
.workspace-leaf,
.workspace-leaf-content,
.view-content,
.markdown-reading-view,
.markdown-preview-view,
.markdown-preview-sizer {
display: block !important;
position: static !important;
width: auto !important;
height: auto !important;
min-width: 0 !important;
min-height: 0 !important;
max-width: none !important;
overflow: visible !important;
contain: none !important;
}

.markdown-preview-sizer {
padding-bottom: 0 !important;
}

.markdown-preview-view {
padding: 0 !important;
}

#mdContent {
padding-right: 0 !important;
}

/* keep backgrounds and code highlight colors */
* {
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}

html,
body {
background-color: var(--background-primary) !important;
}

pre,
pre code {
white-space: pre-wrap !important;
word-break: break-word;
overflow: visible !important;
}

/* page breaks */
pre,
img,
svg,
table,
blockquote,
.callout,
.katex-display,
.perlite-canvas {
break-inside: avoid;
}

h1, h2, h3, h4, h5, h6,
.inline-title {
break-after: avoid;
}

.is-collapsed-callout {
display: block !important;
}

.perlite-canvas {
height: 180mm;
min-height: 0;
}

/* black & white */
body.theme-light.perlite-print-bw {
--background-primary: #fff;
--text-normal: #000;
--text-muted: #333;
--text-faint: #555;
--text-accent: #000;
--inline-title-color: #000;
--h1-color: #000;
--h2-color: #000;
--h3-color: #000;
--h4-color: #000;
--h5-color: #000;
--h6-color: #000;
--bold-color: #000;
--italic-color: #000;
--link-color: #000;
--link-external-color: #000;
--link-unresolved-color: #000;
--tag-color: #000;
}

body.perlite-print-bw a {
text-decoration: underline !important;
}
}
1 change: 0 additions & 1 deletion perlite/.styles/

This file was deleted.

Loading
Loading