forked from platformio/platformio-core
Extra documentation for development platform / frameworks // Resolve #381
This commit is contained in:
@ -69,7 +69,7 @@ release = platformio.__version__
|
|||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
exclude_patterns = ['_build']
|
exclude_patterns = ['_build', '**/*_extra.rst']
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
# documents.
|
# documents.
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from math import ceil
|
from math import ceil
|
||||||
from os.path import dirname, join, realpath
|
from os.path import dirname, isfile, join, realpath
|
||||||
from sys import exit as sys_exit
|
from sys import exit as sys_exit
|
||||||
from sys import path
|
from sys import path
|
||||||
|
|
||||||
@ -215,11 +215,13 @@ Boards
|
|||||||
|
|
||||||
def update_platform_docs():
|
def update_platform_docs():
|
||||||
for name in PlatformFactory.get_platforms().keys():
|
for name in PlatformFactory.get_platforms().keys():
|
||||||
rst_path = join(
|
platforms_dir = join(dirname(realpath(__file__)),
|
||||||
dirname(realpath(__file__)), "..", "docs", "platforms",
|
"..", "docs", "platforms")
|
||||||
"%s.rst" % name)
|
rst_path = join(platforms_dir, "%s.rst" % name)
|
||||||
with open(rst_path, "w") as f:
|
with open(rst_path, "w") as f:
|
||||||
f.write(generate_platform(name))
|
f.write(generate_platform(name))
|
||||||
|
if isfile(join(platforms_dir, "%s_extra.rst" % name)):
|
||||||
|
f.write("\n.. include:: %s_extra.rst\n" % name)
|
||||||
|
|
||||||
|
|
||||||
def generate_framework(type_, data):
|
def generate_framework(type_, data):
|
||||||
@ -302,10 +304,13 @@ Boards
|
|||||||
|
|
||||||
def update_framework_docs():
|
def update_framework_docs():
|
||||||
for name, data in util.get_frameworks().items():
|
for name, data in util.get_frameworks().items():
|
||||||
rst_path = join(util.get_source_dir(), "..", "docs", "frameworks",
|
frameworks_dir = join(dirname(realpath(__file__)),
|
||||||
"%s.rst" % name)
|
"..", "docs", "frameworks")
|
||||||
|
rst_path = join(frameworks_dir, "%s.rst" % name)
|
||||||
with open(rst_path, "w") as f:
|
with open(rst_path, "w") as f:
|
||||||
f.write(generate_framework(name, data))
|
f.write(generate_framework(name, data))
|
||||||
|
if isfile(join(frameworks_dir, "%s_extra.rst" % name)):
|
||||||
|
f.write("\n.. include:: %s_extra.rst\n" % name)
|
||||||
|
|
||||||
|
|
||||||
def update_create_platform_doc():
|
def update_create_platform_doc():
|
||||||
|
Reference in New Issue
Block a user