You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by no...@apache.org on 2014/08/11 19:42:26 UTC
[2/2] git commit: docs: Autolink issue references
docs: Autolink issue references
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8ec35f2c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8ec35f2c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8ec35f2c
Branch: refs/heads/master
Commit: 8ec35f2c7cbefef282fb342f975cb81da486ee60
Parents: fffef4b
Author: Jack Bates <ja...@nottheoilrig.com>
Authored: Mon Aug 11 10:39:48 2014 -0700
Committer: Jack Bates <ja...@nottheoilrig.com>
Committed: Mon Aug 11 10:39:48 2014 -0700
----------------------------------------------------------------------
doc/arch/cache/cache-arch.en.rst | 2 +-
doc/conf.py | 42 +++++++++++++++++++++++-
doc/reference/api/TSLifecycleHookAdd.en.rst | 2 +-
3 files changed, 43 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8ec35f2c/doc/arch/cache/cache-arch.en.rst
----------------------------------------------------------------------
diff --git a/doc/arch/cache/cache-arch.en.rst b/doc/arch/cache/cache-arch.en.rst
index 85384ef..78764d7 100644
--- a/doc/arch/cache/cache-arch.en.rst
+++ b/doc/arch/cache/cache-arch.en.rst
@@ -848,7 +848,7 @@ While this procedure is determinstic it is sensitive to initial conditions, incl
are in the ram cache.
.. [#] This linked list is mostly ignored in later processing, causing all but one file or directory storage units on
- the same device to be ignored. See `TS-1869 <https://issues.apache.org/jira/browse/TS-1869>`_.
+ the same device to be ignored. See TS-1869.
.. [#] It is unclear to me how that can happen, as the offsets are computed later and should all be zero at the time the
spans are coalesced, and as far as I can tell the sort / coalesce is only done during initialization.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8ec35f2c/doc/conf.py
----------------------------------------------------------------------
diff --git a/doc/conf.py b/doc/conf.py
index 69d7454..13ee26f 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -140,6 +140,47 @@ pygments_style = 'sphinx'
nitpicky=1
+# Autolink issue references
+
+import re
+from docutils import nodes
+from docutils.parsers.rst import states
+from docutils.utils import unescape
+
+# Customize parser.inliner in the only way that Sphinx supports.
+# docutils.parsers.rst.Parser takes an instance of states.Inliner or a
+# subclass but Sphinx initializes it from
+# SphinxStandaloneReader.set_parser('restructuredtext') which is called
+# from Publisher.set_components() and initializes the parser without
+# arguments.
+
+BaseInliner = states.Inliner
+class Inliner(BaseInliner):
+ def __init__(self):
+ BaseInliner.__init__(self)
+
+ issue_pattern = re.compile(u'''
+ {start_string_prefix}
+ TS-\d+
+ {end_string_suffix}'''.format(
+ start_string_prefix=self.start_string_prefix,
+ end_string_suffix=self.end_string_suffix),
+ re.VERBOSE | re.UNICODE)
+
+ self.implicit_dispatch.append((issue_pattern, self.issue_reference))
+
+ def issue_reference(self, match, lineno):
+ text = match.group(0)
+
+ rawsource = unescape(text, True)
+ text = unescape(text, False)
+
+ refuri = 'https://issues.apache.org/jira/browse/' + text
+
+ return [nodes.reference(rawsource, text, refuri=refuri)]
+
+states.Inliner = Inliner
+
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -271,7 +312,6 @@ latex_documents = [
# documents and includes the same brief description in both the HTML
# and manual page outputs.
-from docutils import nodes
from docutils.transforms import frontmatter
from sphinx.writers import manpage
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8ec35f2c/doc/reference/api/TSLifecycleHookAdd.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/api/TSLifecycleHookAdd.en.rst b/doc/reference/api/TSLifecycleHookAdd.en.rst
index 672707c..3f58f5c 100644
--- a/doc/reference/api/TSLifecycleHookAdd.en.rst
+++ b/doc/reference/api/TSLifecycleHookAdd.en.rst
@@ -99,7 +99,7 @@ to be initialized and therefore does not work if called from :func:`TSPluginInit
History
=======
-Lifecycle hooks were introduced to solve process initialization ordering issues (`TS-1487 <https://issues.apache.org/jira/browse/TS-1487>`_). Different API calls required
+Lifecycle hooks were introduced to solve process initialization ordering issues (TS-1487). Different API calls required
different modules of Traffic Server to be initialized for the call to work, but others did not work that late in initialization, which was problematic because all of them could effectively only be called from :func:`TSPluginInit` . The
solution was to move :func:`TSPluginInit` as early as possible in the process initialization and provide hooks for API
calls that needed to be invoked later which served essentially as additional pluging initialization points.