From 5035a6627695733076e726321841f7461d54d22d Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Mon, 13 Nov 2023 15:43:04 +0000 Subject: [PATCH 01/11] Maint: Add modeline to jinja files --- ford/templates/absint_list.html | 2 ++ ford/templates/block_list.html | 2 ++ ford/templates/block_page.html | 2 ++ ford/templates/file_list.html | 2 ++ ford/templates/file_page.html | 2 ++ ford/templates/genint_page.html | 2 ++ ford/templates/info_page.html | 2 ++ ford/templates/macros.html | 2 ++ ford/templates/mod_list.html | 2 ++ ford/templates/mod_page.html | 2 ++ ford/templates/namelist_list.html | 2 ++ ford/templates/namelist_page.html | 2 ++ ford/templates/nongenint_page.html | 1 + ford/templates/proc_list.html | 2 ++ ford/templates/proc_page.html | 2 ++ ford/templates/prog_list.html | 2 ++ ford/templates/prog_page.html | 2 ++ ford/templates/type_page.html | 2 ++ ford/templates/types_list.html | 2 ++ 19 files changed, 37 insertions(+) diff --git a/ford/templates/absint_list.html b/ford/templates/absint_list.html index 95dc5105..fdb80f19 100644 --- a/ford/templates/absint_list.html +++ b/ford/templates/absint_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} All Abstract Interfaces – {{ project }} diff --git a/ford/templates/block_list.html b/ford/templates/block_list.html index 9b1d1769..8a1ff0c1 100644 --- a/ford/templates/block_list.html +++ b/ford/templates/block_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} All Block Data Units – {{ project }} diff --git a/ford/templates/block_page.html b/ford/templates/block_page.html index 6d163c7e..14f46e1a 100644 --- a/ford/templates/block_page.html +++ b/ford/templates/block_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %}{{ blockdat.name|striptags }} – {{ project }}{% endblock title %} {% block body %} diff --git a/ford/templates/file_list.html b/ford/templates/file_list.html index 34986c25..f7f227ec 100644 --- a/ford/templates/file_list.html +++ b/ford/templates/file_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} All Files – {{ project }} diff --git a/ford/templates/file_page.html b/ford/templates/file_page.html index 961dd5d9..7fc7d6e5 100644 --- a/ford/templates/file_page.html +++ b/ford/templates/file_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %}s {% block title %}{{ src.name }} – {{ project }}{% endblock title %} {% block body %} diff --git a/ford/templates/genint_page.html b/ford/templates/genint_page.html index ec5da5eb..e41d619d 100644 --- a/ford/templates/genint_page.html +++ b/ford/templates/genint_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %}{{ interface.name }} – {{ project }}{% endblock title %} {% block body %} diff --git a/ford/templates/info_page.html b/ford/templates/info_page.html index 5b27a948..4f75cebe 100644 --- a/ford/templates/info_page.html +++ b/ford/templates/info_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %}{{ page.title }} – {{ project }}{% endblock title %} {% block body %} diff --git a/ford/templates/macros.html b/ford/templates/macros.html index dbe14d8f..23ff2f9b 100644 --- a/ford/templates/macros.html +++ b/ford/templates/macros.html @@ -1,3 +1,5 @@ + + {% macro info_bar(entity, incl_src, base_url, line_info) %}
diff --git a/ford/templates/mod_list.html b/ford/templates/mod_list.html index 984e81d2..bded9476 100644 --- a/ford/templates/mod_list.html +++ b/ford/templates/mod_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} All Modules – {{ project }} diff --git a/ford/templates/mod_page.html b/ford/templates/mod_page.html index 09d7c6de..4ecc0ec6 100644 --- a/ford/templates/mod_page.html +++ b/ford/templates/mod_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %}{{ module.name }} – {{ project }}{% endblock title %} {% block body %} diff --git a/ford/templates/namelist_list.html b/ford/templates/namelist_list.html index 42c76124..e91aaf9d 100644 --- a/ford/templates/namelist_list.html +++ b/ford/templates/namelist_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} diff --git a/ford/templates/namelist_page.html b/ford/templates/namelist_page.html index 70b6053b..2cb41bbd 100644 --- a/ford/templates/namelist_page.html +++ b/ford/templates/namelist_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} diff --git a/ford/templates/nongenint_page.html b/ford/templates/nongenint_page.html index 6dcd0703..f0d377b9 100644 --- a/ford/templates/nongenint_page.html +++ b/ford/templates/nongenint_page.html @@ -1,3 +1,4 @@ + {% extends "base.html" %} {% block title %}{{ interface.name }} – {{ project }}{% endblock title %} diff --git a/ford/templates/proc_list.html b/ford/templates/proc_list.html index a7177293..75474751 100644 --- a/ford/templates/proc_list.html +++ b/ford/templates/proc_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} All Procedures – {{ project }} diff --git a/ford/templates/proc_page.html b/ford/templates/proc_page.html index d8bdaa69..377cd9c7 100644 --- a/ford/templates/proc_page.html +++ b/ford/templates/proc_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %}{{ procedure.name }} – {{ project }}{% endblock title %} {% block body %} diff --git a/ford/templates/prog_list.html b/ford/templates/prog_list.html index 3f931418..b816fed3 100644 --- a/ford/templates/prog_list.html +++ b/ford/templates/prog_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} All Programs – {{ project }} diff --git a/ford/templates/prog_page.html b/ford/templates/prog_page.html index d69ffea4..d4f2c8b7 100644 --- a/ford/templates/prog_page.html +++ b/ford/templates/prog_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %}{% if program.name %}{{ program.name }}{% else %}unnamed{% endif %} – {{ project }}{% endblock title %} {% block body %} diff --git a/ford/templates/type_page.html b/ford/templates/type_page.html index 67ffb6d3..feb19bf8 100644 --- a/ford/templates/type_page.html +++ b/ford/templates/type_page.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %}{{ dtype.name }} – {{ project }} {% endblock title %} {% block body %} diff --git a/ford/templates/types_list.html b/ford/templates/types_list.html index 8e8215b8..56e3ffcc 100644 --- a/ford/templates/types_list.html +++ b/ford/templates/types_list.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} All Types – {{ project }} From 1a8d0b56fa483f608f66a43eefd9eddd73481bb1 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Tue, 14 Nov 2023 13:40:09 +0000 Subject: [PATCH 02/11] Try to ensure all internal links are relative Fixes #581 Relative paths _should_ always work, whether viewing docs as a file or via a web server, either locally or online --- example/pages/subdir/subsubpage.md | 3 ++ ford/__init__.py | 9 +---- ford/_markdown.py | 22 ++++------ ford/external_project.py | 2 +- ford/fortran_project.py | 9 +---- ford/output.py | 57 +++++++++++++------------- ford/pagetree.py | 7 +--- ford/sourceform.py | 65 ++++++++++++++++++++---------- ford/templates/absint_list.html | 6 ++- ford/templates/block_list.html | 6 ++- ford/templates/file_list.html | 5 ++- ford/templates/info_page.html | 4 +- ford/templates/macros.html | 30 +++++++------- ford/templates/mod_list.html | 6 ++- ford/templates/namelist_list.html | 6 ++- ford/templates/proc_list.html | 7 +++- ford/templates/prog_list.html | 6 ++- ford/templates/types_list.html | 7 +++- test/test_example.py | 8 ++-- test/test_graphs.py | 2 +- test/test_markdown.py | 2 +- test/test_project.py | 40 +++++++++--------- test/test_sourceform.py | 62 ++++++++++++---------------- 23 files changed, 198 insertions(+), 173 deletions(-) diff --git a/example/pages/subdir/subsubpage.md b/example/pages/subdir/subsubpage.md index 4eb92d54..b4431ce1 100644 --- a/example/pages/subdir/subsubpage.md +++ b/example/pages/subdir/subsubpage.md @@ -4,3 +4,6 @@ title: Subpage in subdirectory This page is deeper in the hierarchy. You can use `|page|` in URLs to link to other places in the page hierarchy, [such as this other subpage](|page|/subpage1.html) + +You can link to the API documentation with the Ford `[[link]]` style: +[[ford_test_program]] diff --git a/ford/__init__.py b/ford/__init__.py index 819a39b6..443c5836 100755 --- a/ford/__init__.py +++ b/ford/__init__.py @@ -412,8 +412,6 @@ def main(proj_data: ProjectSettings, proj_docs: str): ) sys.exit(1) - base_url = ".." if proj_data.relative else proj_data.project_url - print(" Correlating information from different parts of your project...") correlate_time_start = time.time() project.correlate() @@ -434,20 +432,17 @@ def main(proj_data: ProjectSettings, proj_docs: str): md = MetaMarkdown( proj_data.md_base_dir, + base_url=proj_data.project_url, extensions=proj_data.md_extensions, aliases=aliases, project=project, - relative=proj_data.relative, - base_url=proj_data.project_url, ) # Convert the documentation from Markdown to HTML proj_docs = md.reset().convert(proj_docs) - project.markdown(md, base_url) + project.markdown(md) # Convert summaries and descriptions to HTML - if proj_data.relative: - ford.sourceform.set_base_url(".") if proj_data.summary is not None: proj_data.summary = md.convert(proj_data.summary) if proj_data.author_description is not None: diff --git a/ford/_markdown.py b/ford/_markdown.py index 0286ca6a..5aabd43e 100644 --- a/ford/_markdown.py +++ b/ford/_markdown.py @@ -46,12 +46,11 @@ class MetaMarkdown(Markdown): def __init__( self, md_base: PathLike = ".", + base_url: PathLike = ".", extensions: Optional[List[Union[str, Extension]]] = None, extension_configs: Optional[Dict[str, Dict]] = None, aliases: Optional[Dict[str, str]] = None, project: Optional[Project] = None, - relative: bool = False, - base_url: Optional[PathLike] = None, ): """make thing""" @@ -70,10 +69,8 @@ def __init__( if project is not None: default_extensions.append(FordLinkExtension(project=project)) - if relative: - if base_url is None: - raise ValueError("Expected path for base_url, got None") - default_extensions.append(RelativeLinksExtension(base_url=base_url)) + self.base_url = Path(base_url) + default_extensions.append(RelativeLinksExtension()) if extensions is None: extensions = [] @@ -175,6 +172,7 @@ class FordLinkProcessor(InlineProcessor): def __init__(self, md: MetaMarkdown, project: Project): # type: ignore[overrider] self.project = project self.md: MetaMarkdown = md + self.base_url = md.base_url def getCompiledRegExp(self): return self.LINK_RE @@ -228,7 +226,7 @@ def find_child(context): link.text = name return link - link.attrib["href"] = item.get_url() + link.attrib["href"] = str(self.base_url / item.get_url()) link.text = item.name return link @@ -255,8 +253,8 @@ class RelativeLinksTreeProcessor(Treeprocessor): md: MetaMarkdown - def __init__(self, md: MetaMarkdown, base_url: Path): - self.base_url = base_url.resolve() + def __init__(self, md: MetaMarkdown): + self.base_url = md.base_url.resolve() super().__init__(md) def _fix_attrib(self, tag: Element, attrib: str): @@ -283,11 +281,7 @@ class RelativeLinksExtension(Extension): """Markdown extension to register `RelativeLinksTreeProcessor`""" def __init__(self, **kwargs): - self.config = {"base_url": [kwargs["base_url"], "Base URL of project"]} super().__init__(**kwargs) def extendMarkdown(self, md: MetaMarkdown): # type: ignore[override] - base_url: Path = self.getConfig("base_url") - md.treeprocessors.register( - RelativeLinksTreeProcessor(md, base_url=base_url), "relative_links", 5 - ) + md.treeprocessors.register(RelativeLinksTreeProcessor(md), "relative_links", 5) diff --git a/ford/external_project.py b/ford/external_project.py index c50bd59f..136ef8d0 100644 --- a/ford/external_project.py +++ b/ford/external_project.py @@ -61,7 +61,7 @@ def obj2dict(intObj): return None extDict = { "name": intObj.name, - "external_url": intObj.get_url(), + "external_url": f"./{intObj.get_url()}", "obj": intObj.obj, } if hasattr(intObj, "proctype"): diff --git a/ford/fortran_project.py b/ford/fortran_project.py index 85153e56..4adc6fbc 100755 --- a/ford/fortran_project.py +++ b/ford/fortran_project.py @@ -32,7 +32,6 @@ from ford.console import warn from ford.external_project import load_external_modules from ford.utils import ProgressBar -import ford.sourceform from ford.sourceform import ( _find_in_list, FortranBase, @@ -340,11 +339,6 @@ def filter_modules(entity) -> List[FortranModule]: if not isinstance(container, str): container.prune() - if self.settings.project_url == ".": - url = ".." - else: - url = self.settings.project_url - # Mapping of various entity containers in code units to the # corresponding container in the project CONTAINERS = { @@ -386,11 +380,10 @@ def sum_lines(*argv, **kwargs): self.prog_lines = sum_lines(self.programs) self.block_lines = sum_lines(self.blockdata) - def markdown(self, md, base_url=".."): + def markdown(self, md): """ Process the documentation with Markdown to produce HTML. """ - ford.sourceform.set_base_url(base_url) if self.settings.warn: print() diff --git a/ford/output.py b/ford/output.py index baf09f21..b2113791 100644 --- a/ford/output.py +++ b/ford/output.py @@ -32,10 +32,11 @@ import time from typing import List, Union, Callable, Type, Tuple +from bs4 import BeautifulSoup import jinja2 from ford.console import warn -import ford.sourceform +from ford.sourceform import FortranBase import ford.tipue_search from ford.utils import ProgressBar from ford.graphs import graphviz_installed, GraphManager @@ -71,8 +72,30 @@ def meta(entity, item): return getattr(entity.meta, item, None) +def relative_url(entity: Union[FortranBase, str], page_url: pathlib.Path) -> str: + """Convert any links with absolute paths to the output directory + to relative paths to ``page_url`` + """ + if isinstance(entity, str) and "/" not in entity or entity is None: + return entity + + # Find first link in `entity` and get the path. If `entity` + # doesn't have any links, it might be a URL itself that needs + # fixing + link_str = str(entity) + link = BeautifulSoup(link_str, features="html.parser").a + if link is not None: + link_path = str(pathlib.Path(str(link["href"])).resolve()) + else: + link_path = link_str + + new_path = os.path.relpath(link_path, page_url.parent) + return link_str.replace(link_path, new_path) + + env.tests["more_than_one"] = is_more_than_one env.filters["meta"] = meta +env.filters["relurl"] = relative_url USER_WRITABLE_ONLY = 0o755 @@ -346,11 +369,7 @@ def outfile(self): return self.out_dir / self.list_page def render(self, data, proj, obj): - if data["relative"]: - data["project_url"] = "." - ford.sourceform.set_base_url(".") - ford.pagetree.set_base_url(".") - template = env.get_template(self.list_page) + template = env.get_template(self.list_page, globals=dict(page_url=self.outfile)) return template.render(data, project=proj, proj_docs=obj) @@ -376,11 +395,7 @@ def outfile(self): return self.out_dir / "lists" / self.out_page def render(self, data, proj, obj): - if data["relative"]: - data["project_url"] = ".." - ford.sourceform.set_base_url("..") - ford.pagetree.set_base_url("..") - template = env.get_template(self.list_page) + template = env.get_template(self.list_page, globals=dict(page_url=self.outfile)) return template.render(data, project=proj) @@ -450,11 +465,7 @@ def outfile(self): return self.out_dir / self.obj.get_dir() / self.object_page def render(self, data, project, object): - if data["relative"]: - data["project_url"] = ".." - ford.sourceform.set_base_url("..") - ford.pagetree.set_base_url("..") - template = env.get_template(self.page_path) + template = env.get_template(self.page_path, globals=dict(page_url=self.outfile)) try: return template.render(data, project=project, **{self.payload_key: object}) except jinja2.exceptions.TemplateError: @@ -531,17 +542,9 @@ def outfile(self): return self.page_dir / self.obj.path def render(self, data, proj, obj): - if data["relative"]: - base_url = ("../" * len(obj.hierarchy))[:-1] - if obj.filename.stem == "index": - if len(obj.hierarchy) > 0: - base_url = base_url + "/.." - else: - base_url = ".." - ford.sourceform.set_base_url(base_url) - ford.pagetree.set_base_url(base_url) - data["project_url"] = base_url - template = env.get_template("info_page.html") + template = env.get_template( + "info_page.html", globals=dict(page_url=self.outfile) + ) return template.render(data, page=obj, project=proj, topnode=obj.topnode) def writeout(self): diff --git a/ford/pagetree.py b/ford/pagetree.py index 4bfcb360..be0d5a28 100644 --- a/ford/pagetree.py +++ b/ford/pagetree.py @@ -39,8 +39,6 @@ class PageNode: Object representing a page in a tree of pages and subpages. """ - base_url = Path("..") - def __init__( self, md: MetaMarkdown, @@ -52,6 +50,7 @@ def __init__( ): meta, text = meta_preprocessor(dedent(Path(path).read_text(encoding))) self.meta = EntitySettings.from_markdown_metadata(meta, path.stem) + self.base_url = Path(md.base_url) if self.meta.title is None: raise ValueError(f"Page '{path}' has no title metadata") @@ -183,7 +182,3 @@ def get_page_tree( node.files.append(name) return node - - -def set_base_url(url): - PageNode.base_url = Path(url) diff --git a/ford/sourceform.py b/ford/sourceform.py index 13cbc72a..6cf2dc1e 100644 --- a/ford/sourceform.py +++ b/ford/sourceform.py @@ -182,9 +182,6 @@ class FortranBase: SPLIT_RE = re.compile(r"\s*,\s*", re.IGNORECASE) SRC_CAPTURE_STR = r"^[ \t]*([\w(),*: \t]+?[ \t]+)?{0}([\w(),*: \t]+?)?[ \t]+{1}[ \t\n,(].*?end[ \t]*{0}[ \t]+{1}[ \t]*?(!.*?)?$" - # ~ this regex is not working for the LINK and DOUBLE_LINK types - - base_url = "" pretty_obj = { "proc": "procedures", "type": "derived types", @@ -223,6 +220,7 @@ def __init__( self.display = [] self.settings = ProjectSettings() + self.base_url = pathlib.Path(self.settings.project_url) self.doc_list = read_docstring(source, self.settings.docmark) self.hierarchy = self._make_hierarchy() self.read_metadata() @@ -295,21 +293,28 @@ def get_dir(self) -> Optional[str]: return None - def get_url(self): + def get_url(self) -> Optional[str]: + """URL of this entity, relative to base URL""" + if hasattr(self, "external_url"): return self.external_url + if loc := self.get_dir(): - return f"{self.base_url}/{loc}/{self.ident}.html" - if isinstance( - self, - ( - FortranBoundProcedure, - FortranCommon, - FortranVariable, - FortranEnum, - FortranFinalProc, - FortranProcedure, - ), + return f"{loc}/{self.ident}.html" + + if ( + isinstance( + self, + ( + FortranBoundProcedure, + FortranCommon, + FortranVariable, + FortranEnum, + FortranFinalProc, + FortranProcedure, + ), + ) + and self.parent is not None ): if parent_url := self.parent.get_url(): if "#" in parent_url: @@ -318,6 +323,17 @@ def get_url(self): return None return None + @property + def full_url(self) -> Optional[str]: + """URL of this entity, including the base URL""" + if hasattr(self, "external_url"): + return self.external_url + + if (url := self.get_url()) is not None: + return str(self.base_url / url) + + return None + def lines_description(self, total, total_all=0, obj=None): if not obj: obj = self.obj @@ -340,8 +356,7 @@ def anchor(self) -> str: return f"{self.obj}-{quote(self.ident)}" def __str__(self): - url = self.get_url() - if url and getattr(self, "visible", True): + if (url := self.full_url) and getattr(self, "visible", True): name = self.name or "unnamed" return f"{name}" return self.name or "" @@ -417,7 +432,7 @@ def markdown(self, md: MetaMarkdown): self.meta.summary = "" if self.meta.summary.strip() != self.doc.strip(): - self.meta.summary += f'Read more…' + self.meta.summary += f'Read more…' if self.obj in ["proc", "type", "program"] and self.meta.source: obj = getattr(self, "proctype", self.obj).lower() @@ -1513,6 +1528,7 @@ def __init__( self.path = filepath.strip() self.name = os.path.basename(self.path) self.settings = settings + self.base_url = pathlib.Path(self.settings.project_url) self.fixed = fixed self.parent: Optional[FortranContainer] = None self.modules: List[FortranModule] = [] @@ -2217,6 +2233,7 @@ def __init__( self.parent = parent.parent self.parobj = self.parent.obj if self.parent else None self.settings = parent.settings + self.base_url = pathlib.Path(self.settings.project_url) self.visible = parent.visible self.num_lines = parent.num_lines self.doc_list = doc_list @@ -2246,6 +2263,7 @@ def __init__(self, name, parent, source=None): self.parobj = self.parent.obj self.display = self.parent.display self.settings = self.parent.settings + self.base_url = pathlib.Path(self.settings.project_url) self.doc_list = read_docstring(source, self.settings.docmark) if source else [] self.hierarchy = self._make_hierarchy() self.read_metadata() @@ -2288,6 +2306,9 @@ def __init__( else: self.parobj = None self.settings = None + self.base_url = pathlib.Path( + self.settings.project_url if self.settings else "." + ) self.obj = type(self).__name__[7:].lower() self.attribs = copy.copy(attribs) self.intent = intent @@ -2516,6 +2537,9 @@ def __init__(self, name, parent=None, inherited_permission=None): else: self.parobj = None self.settings = None + self.base_url = pathlib.Path( + self.settings.project_url if self.settings else "." + ) self.name = name self.procedure = None self.doc_list = [] @@ -2708,6 +2732,7 @@ def __init__(self, filename: PathLike, settings: ProjectSettings): self.parent = None self.hierarchy = [] self.settings = settings + self.base_url = self.settings.project_url self.num_lines = 0 filename = pathlib.Path(filename) extra_filetypes = settings.extra_filetypes[str(filename.suffix)[1:]] @@ -3087,10 +3112,6 @@ def parse_type( return ParsedType(vartype, rest, kind=kind) -def set_base_url(url: str) -> None: - FortranBase.base_url = url - - def get_mod_procs( source: FortranReader, names: str, parent: FortranInterface ) -> List[FortranModuleProcedureReference]: diff --git a/ford/templates/absint_list.html b/ford/templates/absint_list.html index fdb80f19..c6411eb4 100644 --- a/ford/templates/absint_list.html +++ b/ford/templates/absint_list.html @@ -13,7 +13,11 @@

Abstract Interfaces

Abstract InterfaceLocationDescription {% for absint in project.absinterfaces|sort(attribute='name') %} - {{ absint }}{{ absint.parent }}{{ absint.procedure | meta('summary') }} + + {{ absint | relurl(page_url) }} + {{ absint.parent | relurl(page_url) }} + {{ absint.procedure | meta('summary') | relurl(page_url) }} + {% endfor %}
diff --git a/ford/templates/block_list.html b/ford/templates/block_list.html index 8a1ff0c1..c0f4a7c4 100644 --- a/ford/templates/block_list.html +++ b/ford/templates/block_list.html @@ -12,7 +12,11 @@

Block Data Units

Block Data UnitSource FileDescription {% for block in project.blockdata|sort(attribute='name') %} - {{ block }}{{ block.parent }}{{ block | meta('summary') }} + + {{ block | relurl(page_url) }} + {{ block.parent | relurl(page_url) }} + {{ block | meta('summary') | relurl(page_url) }} + {% endfor %}
diff --git a/ford/templates/file_list.html b/ford/templates/file_list.html index f7f227ec..8144498b 100644 --- a/ford/templates/file_list.html +++ b/ford/templates/file_list.html @@ -12,7 +12,10 @@

Source Files

FileDescription {% for src in project.allfiles|sort(attribute='name') %} - {{ src }}{{ src | meta('summary') }} + + {{ src | relurl(page_url) }} + {{ src | meta('summary') | relurl(page_url) }} + {% endfor %} {{ project.filegraph }} diff --git a/ford/templates/info_page.html b/ford/templates/info_page.html index 4f75cebe..c53102a2 100644 --- a/ford/templates/info_page.html +++ b/ford/templates/info_page.html @@ -37,13 +37,13 @@

{{ page.title }}

@@ -121,7 +121,7 @@

Contents

Source Code

{% endif %} @@ -223,7 +223,7 @@

Contents

{% endif %} {% if summary -%} - {{ var | meta('summary') }} + {{ var | meta('summary') | relurl(page_url) }} {% else %} {{ var.doc }} {% endif %} @@ -374,7 +374,7 @@

interface {{ deprecated(bind) }}

{% if not bind.visible %} {{ meta_list(bind.meta) }} {% endif %} - {{ bind | meta('summary') }} + {{ bind | meta('summary') | relurl(page_url) }} {% endif %} {{ binding_summary(bind.procedure) }} {% else %} @@ -441,7 +441,7 @@

Dummy Procedures and Procedure Pointers

{% if intr.doc or meta_list(intr.meta)|trim %}
{{ meta_list(intr.meta) }} - {{ intr | meta('summary') }} + {{ intr | meta('summary') | relurl(page_url) }}
{% endif %}