Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Anchors not rendered as intended in the github pages #8335

Closed
softark opened this issue May 9, 2015 · 1 comment
Closed

[docs] Anchors not rendered as intended in the github pages #8335

softark opened this issue May 9, 2015 · 1 comment
Assignees

Comments

@softark
Copy link
Contributor

softark commented May 9, 2015

In #8168, a link (db-dao.md#database-schema) has been modified as (db-dao.md#working-with-database-schema-). IMO, it should be reverted, since the intended anchor name in db-dao.md is 'database-schema'.

But it seems that the modification has been made based on the fact that the anchors are not rendered as intended in the github pages.

For example, this is what we have in http://www.yiiframework.com/doc-2.0/guide-db-dao.html

<h2>
Working with Database Schema 
<span id="database-schema"></span> 
<a href="#working-with-database-schema"
  id="working-with-database-schema"
  class="hashlink">&para;</a>
</h2>
<p>Yii DAO provides ...

But the counterpart of it in https://github.com/yiisoft/yii2/blob/master/docs/guide/db-dao.md is:

<h2>
<a id="user-content-working-with-database-schema-" 
  class="anchor" 
  href="#working-with-database-schema-" 
  aria-hidden="true">
  <span class="octicon octicon-link"></span>
</a>
Working with Database Schema
</h2>
<p>Yii DAO provides ...

(Note that I've reformatted the htmls for the sake of readability)

As you see, <span id="database-schema"></span> is lost in the github version. And the auto created elements are different from each other.

As far as I understand, the policy in the Yii documentation is to use <span id="anchor-name"></span> for an anchor. And I do favor it, because it is easy to refer to from other places of the documentation.

Especially, the auto created anchors based on the heading's text could be a nightmare for multi-byte languages: they will be URL-encoded. For example, https://github.com/yiisoft/yii2/blob/master/docs/guide-ja/db-dao.md goes like the following:

<h2>
<a id="user-content-データベーススキーマを扱う-" 
  class="anchor"
  href="#%E3%83%87%E3%83%BC%E3%82%BF%E3%83%99%E3%83%BC%E3%82%B9%E3%82%B9%E3%82%AD%E3%83%BC%E3%83%9E%E3%82%92%E6%89%B1%E3%81%86-"
  aria-hidden="true">
  <span class="octicon octicon-link"></span>
</a>
データベーススキーマを扱う 
</h2>
<p>Yii DAO は、...

It will be very hard for us to use and maintain such an anchor in the documentation source text.

Although the fact is that the anchors in the span tags are not rendered as intended in the github pages, and I think that we have to deal with the following problems:

  1. In the github pages, the anchors won't work. This is inconvenient even if you are using them just for previewing purpose.
  2. In the Yii site, we don't have the documentations of apps and extensions yet. As for now, the links to them from the Yii 2 guide can do nothing but point to the github pages.
@cebe cebe added the ext:apidoc label May 9, 2015
@cebe cebe added this to the website and infrastructure milestone May 9, 2015
vchenin added a commit to vchenin/yii2 that referenced this issue May 11, 2015
vchenin added a commit to vchenin/yii2 that referenced this issue May 11, 2015
vchenin added a commit to vchenin/yii2 that referenced this issue May 11, 2015
vchenin added a commit to vchenin/yii2 that referenced this issue May 11, 2015
@cebe cebe removed this from the website and infrastructure milestone Jan 24, 2016
@yii-bot
Copy link

yii-bot commented Jan 24, 2016

Issue moved to yiisoft/yii2-apidoc#39

@yii-bot yii-bot closed this as completed Jan 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants