markdown 关于url解析逻辑的注释。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 关于url解析逻辑的注释。相关的知识,希望对你有一定的参考价值。

### Overview

Given //site/`variable`, what are the steps to resolve the template & content.
The priority is from higher to lower. Once a match is found, the chain breaks.

### Logic

1. Check if `variable` is a hardcoded url (like the footer links, about page, login page etc.)
2. Decompose `variable` into its parts (e.g. `["inner-circle", "special-reports"]`)
3. Check if the first part belongs to a subscription (e.g. inner-circle).If it's part of a subscription, use the rules for it (next segment).
5. If it's not part of a subscription, we assume it is free content. Use the template for content and ask the lambda function for the proper `_id`.
6. No match found, show a 404 page.

### Subscription section

1. `/sub-code/` -> the subscription's dashboard
2. `/sub-code/special-reports` -> the list of special reports (where the "view all reports" link leads)
3. `/sub-code/archives` -> issues & updates (where the "view all issues & updates" link leads)
4. `/sub-code/portfolio` -> the portfolio page for the subscription
5. `/sub-code/training` -> the training page (not implemented yet)
6. Reports can belong to multiple products, so they will not have `/sub-code` in-front. It will have a `/report` prefix.
7. `/sub-code/???` -> it would match a single issue/report.

### Qs

1. What should the url for "my subscriptions" be? (it belongs to rule 1 in the Logic section)
2. What is the proper url for a special report? `/reports/???`. It would need to include a unique identifier. Possible example: `/reports/the actual title.${_id}`
3. Same Q for the issues/updates.
4. Do we have a free content in our Mongo set for which we know its real url to help implement the matching for the free articles?

以上是关于markdown 关于url解析逻辑的注释。的主要内容,如果未能解决你的问题,请参考以下文章

markdown [关于黑客贝叶斯方法的注释]请参阅主页:https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayes

关于Tinyhttpd最全注释解析

php url/rest 布尔逻辑解析器

C数据结构单链表接口函数逻辑解析与代码实现(含详细代码注释)

关于实现 Stack Overflow 风格注释的想法

用java理解程序逻辑小结