Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
202cc1a1
Commit
202cc1a1
authored
Mar 05, 2016
by
Marcel Stör
Browse files
Add meta-info block to every module doc page
parent
56843929
Changes
43
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/ws2812.md
View file @
202cc1a1
# WS2812 Module
# 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()
## ws2812.write()
Send GRB data in 8 bits to a WS2812 chain.
Send GRB data in 8 bits to a WS2812 chain.
...
...
docs/js/extra.js
View file @
202cc1a1
...
@@ -10,6 +10,7 @@ var nodemcu = nodemcu || {};
...
@@ -10,6 +10,7 @@ var nodemcu = nodemcu || {};
addToc
();
addToc
();
hideNavigationForAllButSelectedLanguage
();
hideNavigationForAllButSelectedLanguage
();
addLanguageSelectorToRtdFlyOutMenu
();
addLanguageSelectorToRtdFlyOutMenu
();
replaceRelativeLinksWithStaticGitHubUrl
();
});
});
/**
/**
...
@@ -104,6 +105,20 @@ var nodemcu = nodemcu || {};
...
@@ -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
)
{
function
createLanguageLinkFor
(
languageCode
,
isCurrentlySelected
)
{
var
strong
;
var
strong
;
// split[0] is an '' because the path starts with the separator
// split[0] is an '' because the path starts with the separator
...
@@ -146,6 +161,23 @@ var nodemcu = nodemcu || {};
...
@@ -146,6 +161,23 @@ var nodemcu = nodemcu || {};
return
selectedLanguageCode
;
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
)
{
function
values
(
associativeArray
)
{
var
values
=
[];
var
values
=
[];
for
(
var
key
in
associativeArray
)
{
for
(
var
key
in
associativeArray
)
{
...
...
mkdocs.yml
View file @
202cc1a1
...
@@ -57,10 +57,11 @@ pages:
...
@@ -57,10 +57,11 @@ pages:
-
'
ow
(1-Wire)'
:
'
en/modules/ow.md'
-
'
ow
(1-Wire)'
:
'
en/modules/ow.md'
-
'
perf'
:
'
en/modules/perf.md'
-
'
perf'
:
'
en/modules/perf.md'
-
'
pwm'
:
'
en/modules/pwm.md'
-
'
pwm'
:
'
en/modules/pwm.md'
-
'
rc'
:
'
en/modules/rc.md'
-
'
rotary'
:
'
en/modules/rotary.md'
-
'
rotary'
:
'
en/modules/rotary.md'
-
'
rtcfifo'
:
'
en/modules/rtcfifo.md'
-
'
rtcmem'
:
'
en/modules/rtcmem.md'
-
'
rtcmem'
:
'
en/modules/rtcmem.md'
-
'
rtctime'
:
'
en/modules/rtctime.md'
-
'
rtctime'
:
'
en/modules/rtctime.md'
-
'
rtcfifo'
:
'
en/modules/rtcfifo.md'
-
'
sigma
delta'
:
'
en/modules/sigma-delta.md'
-
'
sigma
delta'
:
'
en/modules/sigma-delta.md'
-
'
sntp'
:
'
en/modules/sntp.md'
-
'
sntp'
:
'
en/modules/sntp.md'
-
'
spi'
:
'
en/modules/spi.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