') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Refactor developer docs by damithc · Pull Request #1246 · MarkBind/markbind · GitHub
Skip to content

Refactor developer docs - #1246

Merged
ang-zeyu merged 3 commits into
MarkBind:masterfrom
damithc:tweak-dev-docs
Jun 14, 2020
Merged

Refactor developer docs#1246
ang-zeyu merged 3 commits into
MarkBind:masterfrom
damithc:tweak-dev-docs

Conversation

@damithc

@damithcdamithc commented Jun 13, 2020

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [x] Documentation update

What is the rationale for this request?, What changes did you make? (Give an overview)

See the proposed commit message.

Testing instructions:

Read the DG via the Netlify preview of the PR.

Proposed commit message: (wrap lines at 72 characters)

Refactor developer docs
Let's refactor the dev docs in the following ways to improve the
overall organization:
* Split up into separate pages such as setting up, design, workflow etc.
* Refer to se-education.org/guides when possible
* Improve phrasing, layout, formatting
This reorganization also aims to increase the consistency with other
sister projects such as RepoSense

Let's refactor the dev docs in the following ways to improve the
overall organization:
* Split up into separate pages such as setting up, design, workflow etc.
* Refer to se-education.org/guides when possible
* Improve phrasing, layout, formatting
This reorganization also aim to increase consistency with other
sister projects such as RepoSense
@damithc
damithc marked this pull request as ready for review June 13, 2020 17:46
@damithc

Copy link
Copy Markdown
ContributorAuthor

Ready for review

@ang-zeyuang-zeyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks a lot cleaner now 👍

I gave the parts on build / release process a quick glance only, as it will be substantially changed soon.
The page on project structure as well, since the merge from /vue-strap is coming in

Comment threaddocs/devGuide/workflow.md Outdated
Install developer dependencies (ESLint, related plugins) in your cloned markbind and markbind-cli repositories.

```{.no-line-numbers}
$ npm install --only=dev

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be neccessary anymore, assuming they did a npm install/link

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Comment threaddocs/devGuide/workflow.md Outdated
Before making a commit or pull request, you should lint your code by running the following commands from the root of your project:

* To lint a specific file: `./node_modules/.bin/eslint path/to/specificfile.js`
* To lint all files: `./node_modules/.bin/eslint .`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's update this (all files) to use npm run lint

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment threaddocs/devGuide/workflow.md Outdated

It is also possible to auto-fix some (not all) style errors:
* Add the `--fix` flag to correct any fixable style errors<br>
e.g., `./node_modules/.bin/eslint . --fix`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run lintfix (without the need for --fix as well)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

1. **Install dependencies** by running `npm install` in the root folder of your cloned repo.
1. **To bind your cloned version of MarkBind to your console** (instead of the released version of MarkBind), run `npm link` in the root folder of the cloned repo.

<box type="tip" seamless>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we align the boxes? looks a little strange:

Untitled

@damithcdamithcJun 14, 2020

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boxes are nested at the same level as their logical level in the hierarchy. The first one is outside of the list while the second one applies to the 3rd item in the list only.

In addition, if we don't indent the 2nd box, it will break list numbering. i.e., 4th item will become 1.

@damithc

Copy link
Copy Markdown
ContributorAuthor

Thx for the review @ang-zeyu. I've updated the linting instructions as suggested. Please check in case I misunderstood your comment.

@ang-zeyuang-zeyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm otherwise 👍 Let's squash the commits as well!

Comment threaddocs/devGuide/workflow.md Outdated

* You can start by looking through [these issues](https://github.com/MarkBind/markbind/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+sort%3Acomments-desc) marked <span href="" class="badge" style="color:white; background-color: #7057FF;">good first issue</span>. Don't do more than one of them though.
* As we squash the commits when merging a PR, there is ==no need to follow a strict commit organization or write elaborate commit messages for each commit==.
* You can refer to the [_Design_](design.html) page to learn about the design and implementation of RepoSense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MarkBind 🤣

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps. Fixed.

@ang-zeyu
ang-zeyu merged commit 6eda2b6 into MarkBind:masterJun 14, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@damithc@ang-zeyu