Skip to content

Commit

Permalink
Fix links in "W3C Webdriver Spec" section of the API docs (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
ParmarKrishna authored Apr 1, 2024
1 parent a93ecd7 commit f9050ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions postdoc.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const {
BASE_URL = 'https://nightwatchjs.org',
MD_DOCS_FOLDER = './docs',
API_DOCS_FOLDER = resolve('../nightwatch/lib/api'),
EXAMPLES_FOLDER = 'node_modules/nightwatch-examples/tests'
EXAMPLES_FOLDER = 'node_modules/nightwatch-examples/tests',
WEBDRIVER_SPEC_URL = 'https://w3c.github.io/webdriver',
} = env;

export default {
Expand Down Expand Up @@ -87,6 +88,7 @@ export default {
appSettings: {
version: NIGHTWATCH_VERSION,
baseUrl: BASE_URL,
webdriverSpecUrl : WEBDRIVER_SPEC_URL,
apiRepoUrl: 'https://github.com',
githubRepo: 'nightwatchjs/nightwatch',
docsRepoUrl: 'https://github.com/nightwatchjs/nightwatch-docs/blob/',
Expand All @@ -102,4 +104,4 @@ export default {
logger: {
quiet: false
}
};
};
8 changes: 6 additions & 2 deletions src/includes/api-method.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,12 @@ npx nightwatch <%- method.exampleLink %></code></pre>
<% if (method.link) { %>
<h3>W3C WebDriver spec</h3>
<ul>
<li><code><a href="<%= method.link %>" target="_blank"><%- method.link %></a></code></li>
<ul class="webdriver-spec-link">
<% if (method.link.startsWith('http')) { %>
<li><code><a href="<%- method.link %>" target="_blank"><%= method.link %></a></code></li>
<% } else { %>
<li><code><a href="<%- appSettings.webdriverSpecUrl + method.link %>" target="_blank"><%= method.link %></a></code></li>
<% } %>
</ul>
<% } %>
<% } %>

0 comments on commit f9050ac

Please sign in to comment.