add welcome page

This commit is contained in:
Le Tan 2018-10-18 19:55:01 +08:00
parent 3b2154f45e
commit e46bffa1b1
8 changed files with 71 additions and 33 deletions

View File

@ -0,0 +1,21 @@
# Welcome to VNote
![VNote](qrc:/resources/icons/vnote.svg =128x)
[VNote](https://tamlok.github.io/vnote) is a Vim-inspired note-taking application that knows programmers and Markdown better. VNote provides fancy Markdown experience as well as powerful notes management.
VNote is **open source** and currently mainly developed and maintained by one single person in spare time. Hence, please don't hesitate to give VNote a hand if she does improve your productivity.
## Troubleshooting Guide
1. Go through the context menu, menu bar, tool bar, settings, and help menu to check if you miss something;
2. Changes to configuration may need re-opening current tabs or restarting VNote;
3. There is a Markdown guide and shortcuts guide in the help menu, which might be helpful;
4. Do a quick search in [Github Issues](https://github.com/tamlok/vnote/issues) and VNote's [Documentation](https://vnote.readthedocs.io/en/latest/);
5. Post an issue *in detail* on Github to ask for help.
<mark>One More Thing</mark>: If you do not know what is Vim, please do not turn on Vim mode in the settings dialog. 😁 By the way, Vim is really a magic tool to improve edit efficiency. Highly recommend Vim mode and VNote's shortcuts. You won't regret it.
Now, how about pressing `Ctrl+G` and start today's work from **Universal Entry**?
Have fun!
<a href="https://github.com/tamlok/vnote"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png" alt="Fork me on GitHub"></a>

View File

@ -0,0 +1,21 @@
# 欢迎使用VNote
![VNote](qrc:/resources/icons/vnote.svg =128x)
[VNote](https://tamlok.github.io/vnote) 是一个受Vim启发的、更懂程序员和Markdown的笔记软件。VNote提供了美妙的Markdown体验以及强大的笔记管理。
VNote是**开源**的当前主要由个人在业余时间进行开发和维护。因此如果VNote给您的效率带来了提升请考虑帮助VNote成长。
## 问题解决指南
1. 浏览上下文菜单、菜单栏、工具栏、设置以及帮助菜单;
2. 更改配置可能需要重新打开当前标签页或重启VNote
3. 帮助菜单中包含了一份Markdown语法指南和一份快捷键指南
4. 在[Github Issues](https://github.com/tamlok/vnote/issues)和VNote[文档](https://vnote.readthedocs.io/zh_CN/latest)中搜索您的问题;
5. 在Github上提交一个*详细*的Issue寻求帮助。
<mark>顺带一提</mark>: 如果您不了解Vim请不要在设置对话框中开启Vim模式。😁Vim的确是一个提升编辑效率的神器。强烈推荐熟悉一下Vim模式以及VNote的快捷键。
现在,不妨按下`Ctrl+G`,让一天的工作从**通用入口**开始吧!
Markdown愉快
<a href="https://github.com/tamlok/vnote"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png" alt="Fork me on GitHub"></a>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Welcome VNote</title>
</head>
<body id="preview">
<h1>Welcome to VNote</h1>
<h2>A Vim-Like Note for Markdown</h2>
<p>Under development by Le Tan.
Please contact <a href="mailto:tamlokveer@gmail.com">tamlokveer@gmail.com</a> if you have any questions.
</p>
</body>
</html>

View File

@ -582,6 +582,8 @@ public:
bool getParsePasteLocalImage() const;
bool versionChanged() const;
private:
// Look up a config from user and default settings.
QVariant getConfigFromSettings(const QString &section, const QString &key) const;
@ -2707,4 +2709,9 @@ inline bool VConfigManager::getParsePasteLocalImage() const
{
return m_parsePasteLocalImage;
}
inline bool VConfigManager::versionChanged() const
{
return m_versionChanged;
}
#endif // VCONFIGMANAGER_H

View File

@ -808,7 +808,7 @@ void VMainWindow::initHelpMenu()
connect(mdGuideAct, &QAction::triggered,
this, [this](){
QString docFile = VUtils::getDocFile(VNote::c_markdownGuideDocFile);
VFile *file = vnote->getOrphanFile(docFile, false, true);
VFile *file = vnote->getFile(docFile, true);
m_editArea->openFile(file, OpenFileMode::Read);
});
@ -2458,7 +2458,7 @@ void VMainWindow::enableImageCaption(bool p_checked)
void VMainWindow::shortcutsHelp()
{
QString docFile = VUtils::getDocFile(VNote::c_shortcutsDocFile);
VFile *file = vnote->getOrphanFile(docFile, false, true);
VFile *file = vnote->getFile(docFile, true);
m_editArea->openFile(file, OpenFileMode::Read);
}
@ -2577,14 +2577,7 @@ QVector<VFile *> VMainWindow::openFiles(const QStringList &p_files,
continue;
}
VFile *file = NULL;
if (!p_forceOrphan) {
file = vnote->getInternalFile(p_files[i]);
}
if (!file) {
file = vnote->getOrphanFile(p_files[i], true);
}
VFile *file = vnote->getFile(p_files[i], p_forceOrphan);
m_editArea->openFile(file, p_mode, p_forceMode);
vfiles.append(file);
@ -3340,6 +3333,11 @@ void VMainWindow::kickOffStartUpTimer(const QStringList &p_files)
QCoreApplication::sendPostedEvents();
openStartupPages();
openFiles(p_files, false, g_config->getNoteOpenMode(), false, true);
if (g_config->versionChanged()) {
QString docFile = VUtils::getDocFile("welcome.md");
VFile *file = vnote->getFile(docFile, true);
m_editArea->openFile(file, OpenFileMode::Read);
}
});
}

View File

@ -323,9 +323,13 @@ VNoteFile *VNote::getInternalFile(const QString &p_path)
return file;
}
VFile *VNote::getFile(const QString &p_path)
VFile *VNote::getFile(const QString &p_path, bool p_forceOrphan)
{
VFile *file = getInternalFile(p_path);
VFile *file = NULL;
if (!p_forceOrphan) {
file = getInternalFile(p_path);
}
if (!file) {
QFileInfo fi(p_path);
if (fi.isNativePath()) {

View File

@ -90,12 +90,7 @@ public:
// Given the path of a file, first try to open it as note file,
// then try to open it as orphan file.
VFile *getFile(const QString &p_path);
// Given the path of an external file, create a VOrphanFile struct.
VOrphanFile *getOrphanFile(const QString &p_path,
bool p_modifiable,
bool p_systemFile = false);
VFile *getFile(const QString &p_path, bool p_forceOrphan = false);
// Given the path of a file, try to find it in all notebooks.
// Returns a VNoteFile struct if it is a note in one notebook.
@ -132,6 +127,11 @@ public slots:
private:
const QString &getMonospacedFont() const;
// Given the path of an external file, create a VOrphanFile struct.
VOrphanFile *getOrphanFile(const QString &p_path,
bool p_modifiable,
bool p_systemFile = false);
// Maintain all the notebooks. Other holder should use QPointer.
QVector<VNotebook *> m_notebooks;

View File

@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/">
<file>resources/welcome.html</file>
<file>resources/qwebchannel.js</file>
<file>utils/marked/marked.min.js</file>
<file>utils/highlightjs/highlight.pack.js</file>
@ -275,5 +274,7 @@
<file>resources/export/outline.js</file>
<file>resources/icons/add.svg</file>
<file>resources/icons/delete.svg</file>
<file>resources/docs/welcome_en.md</file>
<file>resources/docs/welcome_zh.md</file>
</qresource>
</RCC>