mirror of https://github.com/laurent22/joplin.git
Merge branch 'master' of github.com:laurent22/joplin
commit
66546418e3
|
@ -28,6 +28,7 @@ const PluginManager = require('lib/services/PluginManager');
|
|||
const RevisionService = require('lib/services/RevisionService');
|
||||
const MigrationService = require('lib/services/MigrationService');
|
||||
const TemplateUtils = require('lib/TemplateUtils');
|
||||
const CssUtils = require('lib/CssUtils');
|
||||
|
||||
const pluginClasses = [
|
||||
require('./plugins/GotoAnything.min'),
|
||||
|
@ -1224,8 +1225,8 @@ class Application extends BaseApplication {
|
|||
ids: Setting.value('collapsedFolderIds'),
|
||||
});
|
||||
|
||||
const cssString = await this.loadCustomCss(`${Setting.value('profileDir')}/userstyle.css`);
|
||||
|
||||
// Loads custom Markdown preview styles
|
||||
const cssString = await CssUtils.loadCustomCss(`${Setting.value('profileDir')}/userstyle.css`);
|
||||
this.store().dispatch({
|
||||
type: 'LOAD_CUSTOM_CSS',
|
||||
css: cssString,
|
||||
|
|
|
@ -413,6 +413,24 @@ class ConfigScreenComponent extends React.Component {
|
|||
{descriptionComp}
|
||||
</div>
|
||||
);
|
||||
} else if (md.type === Setting.TYPE_BUTTON) {
|
||||
const theme = themeStyle(this.props.theme);
|
||||
const buttonStyle = Object.assign({}, theme.buttonStyle, {
|
||||
display: 'inline-block',
|
||||
marginRight: 10,
|
||||
});
|
||||
|
||||
return (
|
||||
<div key={key} style={rowStyle}>
|
||||
<div style={labelStyle}>
|
||||
<label>{md.label()}</label>
|
||||
</div>
|
||||
<button style={buttonStyle} onClick={md.onClick}>
|
||||
{_('Edit')}
|
||||
</button>
|
||||
{descriptionComp}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
console.warn(`Type not implemented: ${key}`);
|
||||
}
|
||||
|
|
|
@ -24,9 +24,9 @@ Three types of applications are available: for the **desktop** (Windows, macOS a
|
|||
|
||||
Operating System | Download | Alternative
|
||||
-----------------|--------|-------------------
|
||||
Windows (32 and 64-bit) | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/Joplin-Setup-1.0.174.exe'><img alt='Get it on Windows' width="134px" src='https://joplinapp.org/images/BadgeWindows.png'/></a> | Or get the <a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/JoplinPortable.exe'>Portable version</a><br><br>The [portable application](https://en.wikipedia.org/wiki/Portable_application) allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file.
|
||||
macOS | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/Joplin-1.0.174.dmg'><img alt='Get it on macOS' width="134px" src='https://joplinapp.org/images/BadgeMacOS.png'/></a> | You can also use Homebrew: `brew cask install joplin`
|
||||
Linux | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/Joplin-1.0.174-x86_64.AppImage'><img alt='Get it on Linux' width="134px" src='https://joplinapp.org/images/BadgeLinux.png'/></a> | An Arch Linux package [is also available](#terminal-application).<br><br>If it works with your distribution (it has been tested on Ubuntu, Fedora, Gnome and Mint), the recommended way is to use this script as it will handle the desktop icon too:<br><br> `wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/Joplin_install_and_update.sh \| bash`
|
||||
Windows (32 and 64-bit) | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/Joplin-Setup-1.0.175.exe'><img alt='Get it on Windows' width="134px" src='https://joplinapp.org/images/BadgeWindows.png'/></a> | Or get the <a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/JoplinPortable.exe'>Portable version</a><br><br>The [portable application](https://en.wikipedia.org/wiki/Portable_application) allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file.
|
||||
macOS | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/Joplin-1.0.175.dmg'><img alt='Get it on macOS' width="134px" src='https://joplinapp.org/images/BadgeMacOS.png'/></a> | You can also use Homebrew: `brew cask install joplin`
|
||||
Linux | <a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/Joplin-1.0.175-x86_64.AppImage'><img alt='Get it on Linux' width="134px" src='https://joplinapp.org/images/BadgeLinux.png'/></a> | An Arch Linux package [is also available](#terminal-application).<br><br>If it works with your distribution (it has been tested on Ubuntu, Fedora, Gnome and Mint), the recommended way is to use this script as it will handle the desktop icon too:<br><br> `wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/Joplin_install_and_update.sh \| bash`
|
||||
|
||||
## Mobile applications
|
||||
|
||||
|
@ -259,6 +259,8 @@ Joplin uses and renders a Github-flavoured Markdown with a few variations and ad
|
|||
|
||||
Rendered markdown can be customized by placing a userstyle file in the profile directory `~/.config/joplin-desktop/userstyle.css` (This path might be different on your device - check at the top of the Config screen for the exact path). This file supports standard CSS syntax. Joplin ***must*** be restarted for the new css to be applied, please ensure that Joplin is not closing to the tray, but is actually exiting. Note that this file is used for both displaying the notes and printing the notes. Be aware how the CSS may look printed (for example, printing white text over a black background is usually not wanted).
|
||||
|
||||
Editor styles can be customized by placing a custom editor style file in the profile directory `~/.config/joplin-desktop/userchrome.css`.
|
||||
|
||||
# Note templates
|
||||
|
||||
In the **desktop app**, templates can be used to create new notes or to insert into existing ones by creating a `templates` folder in Joplin's config folder and placing Markdown template files into it. For example creating the file `hours.md` in the `templates` directory with the contents:
|
||||
|
|
|
@ -39,6 +39,7 @@ const BaseService = require('lib/services/BaseService');
|
|||
const SearchEngine = require('lib/services/SearchEngine');
|
||||
const KvStore = require('lib/services/KvStore');
|
||||
const MigrationService = require('lib/services/MigrationService');
|
||||
const CssUtils = require('lib/CssUtils');
|
||||
|
||||
SyncTargetRegistry.addClass(SyncTargetFilesystem);
|
||||
SyncTargetRegistry.addClass(SyncTargetOneDrive);
|
||||
|
@ -609,6 +610,11 @@ class BaseApplication {
|
|||
|
||||
await Setting.load();
|
||||
|
||||
// Loads app-wide styles. (Markdown preview-specific styles loaded in app.js)
|
||||
const dir = Setting.value('profileDir');
|
||||
const filename = Setting.custom_css_files.JOPLIN_APP;
|
||||
await CssUtils.injectCustomStyles(`${dir}/${filename}`);
|
||||
|
||||
if (!Setting.value('clientId')) Setting.setValue('clientId', uuid.create());
|
||||
|
||||
if (Setting.value('firstStart')) {
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
const fs = require('fs-extra');
|
||||
|
||||
const loadCustomCss = async filePath => {
|
||||
let cssString = '';
|
||||
if (await fs.pathExists(filePath)) {
|
||||
try {
|
||||
cssString = await fs.readFile(filePath, 'utf-8');
|
||||
} catch (error) {
|
||||
let msg = error.message ? error.message : '';
|
||||
msg = `Could not load custom css from ${filePath}\n${msg}`;
|
||||
error.message = msg;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
return cssString;
|
||||
};
|
||||
|
||||
const injectCustomStyles = async cssFilePath => {
|
||||
const css = await loadCustomCss(cssFilePath);
|
||||
const styleTag = document.createElement('style');
|
||||
styleTag.type = 'text/css';
|
||||
styleTag.appendChild(document.createTextNode(css));
|
||||
document.head.appendChild(styleTag);
|
||||
};
|
||||
|
||||
module.exports = {loadCustomCss, injectCustomStyles};
|
|
@ -1,9 +0,0 @@
|
|||
const layoutUtils = {};
|
||||
|
||||
layoutUtils.size = function(preferred, min, max) {
|
||||
if (preferred < min) return min;
|
||||
if (typeof max !== 'undefined' && preferred > max) return max;
|
||||
return preferred;
|
||||
};
|
||||
|
||||
module.exports = layoutUtils;
|
|
@ -410,6 +410,43 @@ class Setting extends BaseModel {
|
|||
},
|
||||
'style.sidebar.width': { value: 150, minimum: 80, maximum: 400, type: Setting.TYPE_INT, public: false, appTypes: ['desktop'] },
|
||||
'style.noteList.width': { value: 150, minimum: 80, maximum: 400, type: Setting.TYPE_INT, public: false, appTypes: ['desktop'] },
|
||||
|
||||
// TODO: Is there a better way to do this? The goal here is to simply have
|
||||
// a way to display a link to the customizable stylesheets, not for it to
|
||||
// serve as a customizable Setting. But because the Setting page is auto-
|
||||
// generated from this list of settings, there wasn't a really elegant way
|
||||
// to do that directly in the React markup.
|
||||
'style.customCss.renderedMarkdown': {
|
||||
onClick: () => {
|
||||
const dir = Setting.value('profileDir');
|
||||
const filename = Setting.custom_css_files.RENDERED_MARKDOWN;
|
||||
const filepath = `${dir}/${filename}`;
|
||||
const defaultContents = '/* For styling the rendered Markdown */';
|
||||
|
||||
shim.openOrCreateFile(filepath, defaultContents);
|
||||
},
|
||||
type: Setting.TYPE_BUTTON,
|
||||
public: true,
|
||||
appTypes: ['desktop'],
|
||||
label: () => _('Custom stylesheet for rendered Markdown'),
|
||||
section: 'appearance',
|
||||
},
|
||||
'style.customCss.joplinApp': {
|
||||
onClick: () => {
|
||||
const dir = Setting.value('profileDir');
|
||||
const filename = Setting.custom_css_files.JOPLIN_APP;
|
||||
const filepath = `${dir}/${filename}`;
|
||||
const defaultContents = `/* For styling the entire Joplin app (except the rendered Markdown, which is defined in \`${Setting.custom_css_files.RENDERED_MARKDOWN}\`) */`;
|
||||
|
||||
shim.openOrCreateFile(filepath, defaultContents);
|
||||
},
|
||||
type: Setting.TYPE_BUTTON,
|
||||
public: true,
|
||||
appTypes: ['desktop'],
|
||||
label: () => _('Custom stylesheet for Joplin-wide app styles'),
|
||||
section: 'appearance',
|
||||
},
|
||||
|
||||
autoUpdateEnabled: { value: true, type: Setting.TYPE_BOOL, section: 'application', public: true, appTypes: ['desktop'], label: () => _('Automatically update the application') },
|
||||
'autoUpdate.includePreReleases': { value: false, type: Setting.TYPE_BOOL, section: 'application', public: true, appTypes: ['desktop'], label: () => _('Get pre-releases when checking for updates'), description: () => _('See the pre-release page for more details: %s', 'https://joplinapp.org/prereleases') },
|
||||
'clipperServer.autoStart': { value: false, type: Setting.TYPE_BOOL, public: false },
|
||||
|
@ -937,6 +974,7 @@ Setting.TYPE_STRING = 2;
|
|||
Setting.TYPE_BOOL = 3;
|
||||
Setting.TYPE_ARRAY = 4;
|
||||
Setting.TYPE_OBJECT = 5;
|
||||
Setting.TYPE_BUTTON = 6;
|
||||
|
||||
Setting.THEME_LIGHT = 1;
|
||||
Setting.THEME_DARK = 2;
|
||||
|
@ -966,6 +1004,12 @@ Setting.DATE_FORMAT_6 = 'DD.MM.YYYY';
|
|||
Setting.TIME_FORMAT_1 = 'HH:mm';
|
||||
Setting.TIME_FORMAT_2 = 'h:mm A';
|
||||
|
||||
Setting.custom_css_files = {
|
||||
JOPLIN_APP: 'userchrome.css',
|
||||
RENDERED_MARKDOWN: 'userstyle.css',
|
||||
};
|
||||
|
||||
|
||||
// Contains constants that are set by the application and
|
||||
// cannot be modified by the user:
|
||||
Setting.constants_ = {
|
||||
|
|
|
@ -358,7 +358,23 @@ function shimInit() {
|
|||
|
||||
shim.openUrl = url => {
|
||||
const { bridge } = require('electron').remote.require('./bridge');
|
||||
bridge().openExternal(url);
|
||||
// Returns true if it opens the file successfully; returns false if it could
|
||||
// not find the file.
|
||||
return bridge().openExternal(url);
|
||||
};
|
||||
|
||||
shim.openOrCreateFile = (filepath, defaultContents) => {
|
||||
// If the file doesn't exist, create it
|
||||
if (!fs.existsSync(filepath)) {
|
||||
fs.writeFile(filepath, defaultContents, 'utf-8', (error) => {
|
||||
if (error) {
|
||||
console.error(`error: ${error}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Open the file
|
||||
return shim.openUrl(`file://${filepath}`);
|
||||
};
|
||||
|
||||
shim.waitForFrame = () => {};
|
||||
|
|
|
@ -190,6 +190,9 @@ shim.Buffer = null;
|
|||
shim.openUrl = () => {
|
||||
throw new Error('Not implemented');
|
||||
};
|
||||
shim.openOrCreateFile = () => {
|
||||
throw new Error('Not implemented');
|
||||
};
|
||||
shim.waitForFrame = () => {
|
||||
throw new Error('Not implemented');
|
||||
};
|
||||
|
|
|
@ -336,7 +336,7 @@ https://github.com/laurent22/joplin/blob/master/
|
|||
<hr>
|
||||
<p>🌞 <a href="https://joplinapp.org/gsoc/">Joplin is applying for Google Summer of Code 2020</a> 🌞</p>
|
||||
<hr>
|
||||
<p>Joplin is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in <a href="#markdown">Markdown format</a>.</p>
|
||||
<p><img width="64" src="https://raw.githubusercontent.com/laurent22/joplin/master/Assets/LinuxIcons/256x256.png" align="left" /> <strong>Joplin</strong> is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in <a href="#markdown">Markdown format</a>.</p>
|
||||
<p>Notes exported from Evernote via .enex files <a href="#importing">can be imported</a> into Joplin, including the formatted content (which is converted to Markdown), resources (images, attachments, etc.) and complete metadata (geolocation, updated time, created time, etc.). Plain Markdown files can also be imported.</p>
|
||||
<p>The notes can be <a href="#synchronisation">synchronised</a> with various cloud services including <a href="https://nextcloud.com/">Nextcloud</a>, Dropbox, OneDrive, WebDAV or the file system (for example with a network directory). When synchronising the notes, notebooks, tags and other metadata are saved to plain text files which can be easily inspected, backed up and moved around.</p>
|
||||
<p>The application is available for Windows, Linux, macOS, Android and iOS (the terminal app also works on FreeBSD). A <a href="https://joplinapp.org/clipper/">Web Clipper</a>, to save web pages and screenshots from your browser, is also available for <a href="https://addons.mozilla.org/en-US/firefox/addon/joplin-web-clipper/">Firefox</a> and <a href="https://chrome.google.com/webstore/detail/joplin-web-clipper/alofnhikmmkdbbbgpnglcpdollgjjfek?hl=en-GB">Chrome</a>.</p>
|
||||
|
@ -355,17 +355,17 @@ https://github.com/laurent22/joplin/blob/master/
|
|||
<tbody>
|
||||
<tr>
|
||||
<td>Windows (32 and 64-bit)</td>
|
||||
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/Joplin-Setup-1.0.174.exe'><img alt='Get it on Windows' width="134px" src='https://joplinapp.org/images/BadgeWindows.png'/></a></td>
|
||||
<td>Or get the <a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/JoplinPortable.exe'>Portable version</a><br><br>The <a href="https://en.wikipedia.org/wiki/Portable_application">portable application</a> allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file.</td>
|
||||
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/Joplin-Setup-1.0.175.exe'><img alt='Get it on Windows' width="134px" src='https://joplinapp.org/images/BadgeWindows.png'/></a></td>
|
||||
<td>Or get the <a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/JoplinPortable.exe'>Portable version</a><br><br>The <a href="https://en.wikipedia.org/wiki/Portable_application">portable application</a> allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>macOS</td>
|
||||
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/Joplin-1.0.174.dmg'><img alt='Get it on macOS' width="134px" src='https://joplinapp.org/images/BadgeMacOS.png'/></a></td>
|
||||
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/Joplin-1.0.175.dmg'><img alt='Get it on macOS' width="134px" src='https://joplinapp.org/images/BadgeMacOS.png'/></a></td>
|
||||
<td>You can also use Homebrew: <code>brew cask install joplin</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linux</td>
|
||||
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.174/Joplin-1.0.174-x86_64.AppImage'><img alt='Get it on Linux' width="134px" src='https://joplinapp.org/images/BadgeLinux.png'/></a></td>
|
||||
<td><a href='https://github.com/laurent22/joplin/releases/download/v1.0.175/Joplin-1.0.175-x86_64.AppImage'><img alt='Get it on Linux' width="134px" src='https://joplinapp.org/images/BadgeLinux.png'/></a></td>
|
||||
<td>An Arch Linux package <a href="#terminal-application">is also available</a>.<br><br>If it works with your distribution (it has been tested on Ubuntu, Fedora, Gnome and Mint), the recommended way is to use this script as it will handle the desktop icon too:<br><br> <code>wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/Joplin_install_and_update.sh | bash</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -383,7 +383,7 @@ https://github.com/laurent22/joplin/blob/master/
|
|||
<tr>
|
||||
<td>Android</td>
|
||||
<td><a href='https://play.google.com/store/apps/details?id=net.cozic.joplin&utm_source=GitHub&utm_campaign=README&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="40px" src='https://joplinapp.org/images/BadgeAndroid.png'/></a></td>
|
||||
<td>or download the APK file: <a href="https://github.com/laurent22/joplin-android/releases/download/android-v1.0.311/joplin-v1.0.311.apk">64-bit</a> <a href="https://github.com/laurent22/joplin-android/releases/download/android-v1.0.311/joplin-v1.0.311-32bit.apk">32-bit</a></td>
|
||||
<td>or download the APK file: <a href="https://github.com/laurent22/joplin-android/releases/download/android-v1.0.312/joplin-v1.0.312.apk">64-bit</a> <a href="https://github.com/laurent22/joplin-android/releases/download/android-v1.0.312/joplin-v1.0.312-32bit.apk">32-bit</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iOS</td>
|
||||
|
@ -492,7 +492,6 @@ https://github.com/laurent22/joplin/blob/master/
|
|||
<p>WebDAV-compatible services that are known to work with Joplin:</p>
|
||||
<ul>
|
||||
<li><a href="https://httpd.apache.org/docs/current/mod/mod_dav.html">Apache WebDAV Module</a></li>
|
||||
<li><a href="https://www.box.com/">Box.com</a></li>
|
||||
<li><a href="https://www.drivehq.com">DriveHQ</a></li>
|
||||
<li><a href="https://www.fastmail.com/">Fastmail</a></li>
|
||||
<li><a href="https://www.strato.fr/stockage-en-ligne/">HiDrive</a> from Strato. <a href="https://github.com/laurent22/joplin/issues/309">Setup help</a></li>
|
||||
|
|
Loading…
Reference in New Issue