We are really excited that you are interested in contributing to Mark Text 🎉. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.
Please search for similar issues before opening an issue and always follow the issue template. Please provide a detailed description of the problem in your PR and live demo or screenshots are preferred.
-
Submit PRs directly to the
develop
branch. -
Work in the
src
folder and DO NOT checkindist
in commits. -
If you adding new feature:
- Open a suggestion issue first.
- Provide convincing reason to add this feature.
- Then submit your PR.
-
If fixing a bug:
- If you are resolving a special issue, add
fix: #xxx[,#xxx] <short message>
(#xxx
is the issue id) in your PR title for a better release log, e.g.fix: #3899 update entities encoding/decoding
. - Update
.github/CHANGELOG.md
for notable changes - like bug fixes and features. - Provide detailed description of the bug in your PR and/or link to the issue. You can also include screenshots.
- If you are resolving a special issue, add
-
Please lint and test your PR before submitting.
-
All PRs need to pass the Travis CI before merged. If it fails, please try to solve the issue(s) and feel free to ask for any help.
Find a issue flagged as a bug
, help wanted
or enhancement
. The good first issue
issues are good for new comers. Discuss the solution in the issue and after the final solution is approved by the Mark Text members, you can submit/work on the PR. For small fixes, you can directly open a PR.
Other ways to help:
- Documentation (*1)
- Translation (*1)
- Help to answer
more detail
issues or discuss changes and features. - Report bugs and feature ideas.
- Give feedback.
*1: More or less blocked until v1.0 release because of early development phase.
- Fork the repository.
- Clone your fork:
git clone [email protected]:<username>/marktext.git
- Create a feature branch:
git checkout -b feature
- Make you changes and push your branch.
- Create a PR against
develop
and describe your changes.
Rebase your PR:
If there are conflicts or you want to update your local branch, please do the following:
git fetch upstream
git rebase upstream/develop
- Please resolve all conflicts and force push your feature branch:
git push -f
Prerequisites:
Before you can get started developing, you need set up your build environment:
- Node.js
>=v10.16.0
, npm and yarn - Python
v2.7.x
for node-gyp - C++ compiler and development tools
Additional development dependencies on Linux:
- libx11 (dev)
- libxkbfile (dev)
- libsecret (dev)
On Debian-based Linux: sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev
On Red Hat-based Linux: sudo dnf install libx11-devel libxkbfile-devel libsecret-devel
Let's build:
- Go to
marktext
folder - Install dependencies:
yarn install
oryarn install --frozen-lockfile
- Build Mark Text:
npm run build
- Mark Text binary is located under
build
folder
Copy the build app to applications folder, or if on Windows run the executable installer.
Important scripts:
$ npm run <script> # or yarn run <script>
Script | Description |
---|---|
build |
Build Mark Text binaries for your OS |
dev |
Build and run Mark Text in developer mode |
lint |
Lint code style |
test / unit |
Run unit tests |
For more scripts please see package.json
.
- ES6 and "best practices"
- 2 space indent
- no semicolons
- JSDoc for documentation
.
: Configuration filespackage.json
: Project settingsbuild/
: Contains generated binariesdist/
: Build files for deploymentdocs/
: Documentation and assetsresources/
: Application assets using at build timenode_modules/
: Dependenciessrc
: Mark Text source codecommon/
: Common source files that only require Node.js APIs. Code from this folder can be used in all other folders exceptmuya
.main/
: Main process source files that require Electron main-process APIs.main
files can usecommon
source code.muya/
: Mark Texts backend that only allow pure JavaScript, BOM and DOM APIs. Don't use Electron or Node.js APIs!renderer
: Fontend that require Electron renderer-process APIs and may usecommon
ormuya
source code.
static/
: Application assets (images, themes, etc)test/
: Contains (unit) tests