@@ -319,7 +319,7 @@ def get_theme_names():
319
319
320
320
321
321
def dirname_to_title (dirname ):
322
-
322
+ """ Return a page tile obtained from a directory name. """
323
323
title = dirname
324
324
title = title .replace ('-' , ' ' ).replace ('_' , ' ' )
325
325
# Capitalize if the dirname was all lowercase, otherwise leave it as-is.
@@ -330,22 +330,22 @@ def dirname_to_title(dirname):
330
330
331
331
332
332
def get_markdown_title (markdown_src ):
333
- """
334
- Get the title of a Markdown document. The title in this case is considered
335
- to be a H1 that occurs before any other content in the document.
336
- The procedure is then to iterate through the lines, stopping at the first
337
- non-whitespace content. If it is a title, return that, otherwise return
338
- None.
339
- """
333
+ """
334
+ Get the title of a Markdown document. The title in this case is considered
335
+ to be a H1 that occurs before any other content in the document.
336
+ The procedure is then to iterate through the lines, stopping at the first
337
+ non-whitespace content. If it is a title, return that, otherwise return
338
+ None.
339
+ """
340
340
341
- lines = markdown_src .replace ('\r \n ' , '\n ' ).replace ('\r ' , '\n ' ).split ('\n ' )
342
- while lines :
343
- line = lines .pop (0 ).strip ()
344
- if not line .strip ():
345
- continue
346
- if not line .startswith ('# ' ):
347
- return
348
- return line .lstrip ('# ' )
341
+ lines = markdown_src .replace ('\r \n ' , '\n ' ).replace ('\r ' , '\n ' ).split ('\n ' )
342
+ while lines :
343
+ line = lines .pop (0 ).strip ()
344
+ if not line .strip ():
345
+ continue
346
+ if not line .startswith ('# ' ):
347
+ return
348
+ return line .lstrip ('# ' )
349
349
350
350
351
351
def find_or_create_node (branch , key ):
0 commit comments