Skip to content

Commit

Permalink
Tool will now warn you if you try to link to a Markdown file in the p…
Browse files Browse the repository at this point in the history
…roject that doesn't exist.

Signed-off-by: Kevin Putnam <kevin.putnam@intel.com>
  • Loading branch information
intelkevinputnam committed Mar 9, 2022
1 parent 8e1baf1 commit 640973f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sphinx_md/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from os.path import isdir, isfile, join, basename, dirname
from os import makedirs
from shutil import copyfile
from sphinx.util import logging

logger = logging.getLogger(__name__)

##############################################################################
#
Expand Down Expand Up @@ -149,6 +152,8 @@ def fixLocalMDAnchors(app, doctree, docname):
if isdir(filePath):
newURI = githubDirURL + filePath
node['refuri']=newURI
if ".md" in uri:
logger.warning('Markdown file does not exist: ' + uri, location=node)

def setup(app):
app.add_config_value('sphinx_md_useGitHubURL',False,'')
Expand Down

0 comments on commit 640973f

Please sign in to comment.