Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
eff1b6fb
Commit
eff1b6fb
authored
Mar 08, 2016
by
Johny Mattsson
Browse files
Merge pull request #1120 from marcelstoer/dev-modules-list
Add meta-info block to every module doc page
parents
76f2654f
202cc1a1
Changes
43
Show whitespace changes
Inline
Side-by-side
docs/en/modules/ws2812.md
View file @
eff1b6fb
# WS2812 Module
| Since | Origin / Contributor | Maintainer | Source |
| :----- | :-------------------- | :---------- | :------ |
| 2015-02-05 |
[
Till Klocke
](
https://github.com/dereulenspiegel
)
|
[
Till Klocke
](
https://github.com/dereulenspiegel
)
|
[
ws2812.c
](
../../../app/modules/ws2812.c
)
|
## ws2812.write()
Send GRB data in 8 bits to a WS2812 chain.
...
...
docs/js/extra.js
View file @
eff1b6fb
...
...
@@ -10,6 +10,7 @@ var nodemcu = nodemcu || {};
addToc
();
hideNavigationForAllButSelectedLanguage
();
addLanguageSelectorToRtdFlyOutMenu
();
replaceRelativeLinksWithStaticGitHubUrl
();
});
/**
...
...
@@ -104,6 +105,20 @@ var nodemcu = nodemcu || {};
}
}
/**
* The module doc pages contain relative links to artifacts in the GitHub repository. For those links to work both
* on GitHub (i.e. when the page is viewed on GitHub) and on RTD they are defined with a relative URL. This function
* replaces the relative path with an absolute path based on the selected branch.
*/
function
replaceRelativeLinksWithStaticGitHubUrl
()
{
var
relativePath
=
"
../../../..
"
;
var
gitHubPath
=
"
https://github.com/nodemcu/nodemcu-firmware/tree/
"
+
determineSelectedBranch
();
var
gitHubLinks
=
$
(
"
a[href^='
"
+
relativePath
+
"
']
"
).
each
(
function
(
index
)
{
var
url
=
$
(
this
).
attr
(
'
href
'
);
$
(
this
).
attr
(
'
href
'
,
url
.
replace
(
relativePath
,
gitHubPath
));
});
}
function
createLanguageLinkFor
(
languageCode
,
isCurrentlySelected
)
{
var
strong
;
// split[0] is an '' because the path starts with the separator
...
...
@@ -146,6 +161,23 @@ var nodemcu = nodemcu || {};
return
selectedLanguageCode
;
}
/**
* Analyzes the URL of the current page to find out what the selected GitHub branch is. It's usually
* part of the location path. The code needs to distinguish between running MkDocs standalone
* and docs served from RTD. If no valid branch could be determined 'dev' returned.
*
* @returns GitHub branch name
*/
function
determineSelectedBranch
()
{
var
branch
=
'
dev
'
,
path
=
window
.
location
.
pathname
;
if
(
window
.
location
.
origin
.
indexOf
(
'
readthedocs
'
)
>
-
1
)
{
// path is like /en/<branch>/<lang>/build/ -> extract 'lang'
// split[0] is an '' because the path starts with the separator
branch
=
path
.
split
(
'
/
'
)[
2
];
}
return
branch
;
}
function
values
(
associativeArray
)
{
var
values
=
[];
for
(
var
key
in
associativeArray
)
{
...
...
mkdocs.yml
View file @
eff1b6fb
...
...
@@ -57,10 +57,11 @@ pages:
-
'
ow
(1-Wire)'
:
'
en/modules/ow.md'
-
'
perf'
:
'
en/modules/perf.md'
-
'
pwm'
:
'
en/modules/pwm.md'
-
'
rc'
:
'
en/modules/rc.md'
-
'
rotary'
:
'
en/modules/rotary.md'
-
'
rtcfifo'
:
'
en/modules/rtcfifo.md'
-
'
rtcmem'
:
'
en/modules/rtcmem.md'
-
'
rtctime'
:
'
en/modules/rtctime.md'
-
'
rtcfifo'
:
'
en/modules/rtcfifo.md'
-
'
sigma
delta'
:
'
en/modules/sigma-delta.md'
-
'
sntp'
:
'
en/modules/sntp.md'
-
'
spi'
:
'
en/modules/spi.md'
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment