├── LICENSE ├── README.md ├── index.html ├── 易网页.css └── 易网页.js /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 易网页 2 | 3 | 中文的如何做爱超文本标记语言 4 | 5 | 6 | >随着国内前端程序员越来越多,学习英文的网页语言渐渐地成为了负担。为了顺应中文编程的需求,现在已经有不少成型的中文脚本语言,但中文的超文本标记语言还没有见到,这才有了「易网页」语言! 7 | 8 | ## 官方首页 9 | [http://front.dog/e/](http://front.dog/e/) 10 | 11 | ## 如何使用易网页? 12 | 13 | 易网页语言上手极其简单,引用 `易网页.js` 并执行 `易网页.变身(document.body)` 即完成了易网页的启动和转义! 14 | 15 | 1. 使用【】符号包裹标签名。(备注一,备注二) 16 | 2. 样式表中同样可以中文表达式书写。(备注三) 17 | 3. 使用:符号赋值属性。 18 | 4. 网页源代码里都是中文了你还要啥? (ᴑ̨̨̍̆͞͡ ͦ̆ ॑ᵓ̩̗̍ 19 | 20 |
备注一: 避免了 在手写中文正文网页代码时不断切换输入法状态 来输入<>。 21 |
22 | 23 |
备注二: 标题上 你可以使用「大标题」、「标题一」等多个意义相同的中文标签名,但要注意尽量避开【】这两个符号的使用,使用括号时推荐使用更加能体现中文波大茎深的以及 符号 24 |
25 | 26 |
备注三: 配合易网页指定样式表时,易网页会把中文标签改为标签相应的 ClassName 名,所以还是需要在表达式中使用类表达式。 27 |
28 | 29 |
30 | 有什么不懂的其实直接看下当前网页的源代码就好啦~ 31 |
32 | 33 | ## 2015-08-31 增加一种更加中文的结束语法 34 | 35 | 1. 原有的 `【、标签】` 结束语法 36 | 2. 新增的 `【标签。】` 结束语法 37 | 38 | 39 | ## 增加两种「闭合任意标签」标示符 40 | 41 | 1. 通过`【、】`、`【。】`标示符,可「闭合前一个打开的标签」。 42 | 43 | 感谢 [@Arthur2e5](https://github.com/Arthur2e5) 的 Issues https://github.com/itorr/e/issues/4 44 | 45 | 46 | 引用: 47 | 48 | 1. [Standard Generalized Markup Language - Wikipedia, the free encyclopedia](https://en.wikipedia.org/wiki/Standard_Generalized_Markup_Language#SHORTTAG) 49 | 2. [SHORTTAGS – THE ODD SIDE OF HTML 4.01](https://www.w3.org/blog/2007/10/shorttags/) 50 | 3. [Appendix B: Performance, Implementation, and Design Notes](https://www.w3.org/TR/html401/appendix/notes.html#h-B.3.7) 51 | 52 | 53 | ## 男同性恋集线器 交流平台地址 54 | 55 | [http://github.com/itorr/e](http://github.com/itorr/e) 56 | 57 | 58 | ![二维码](http://ww4.sinaimg.cn/large/a15b4afegw1evl6fnyss1j205k05kdg3) 59 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 易网页 4 | 5 | 【样式表 目标:「易网页.css」】 6 | 【头部】 7 | 【大标题】易网页【。】 8 | 【副标题】中文的【删除】如何做爱【。】超文本标记语言【。】 9 | 【头部。】 10 | 【引用】随着国内前端程序员越来越多,学习英文的网页语言渐渐地成为了负担。为了顺应中文编程的需求,现在已经有不少成型的中文脚本语言,但中文的超文本标记语言还没有见到,这才有了【着重】「易网页」【着重。】语言!【引用。】 11 | 12 | 【二标题】如何使用易网页?【二标题。】 13 | 【段落】易网页语言上手极其简单,引用 【代码】易网页.js【代码。】并执行【代码】易网页.变身(document.body)【代码。】即完成了易网页的启动和转义!【段落。】 14 | 【有序列表】 15 | 【列表项】使用【代码】【】【代码。】符号包裹标签名。(【超链接 目标:「#备注一」】备注一【超链接。】,【超链接 目标:「#备注二」】备注二【超链接。】)【列表项。】 16 | 【列表项】样式表中同样可以中文表达式书写。(【超链接 目标:「#备注三」】备注三【超链接。】)【列表项。】 17 | 【列表项】使用【代码】:【代码。】符号赋值属性。【列表项。】 18 | 【列表项】网页源代码里全是中文了你还要啥? (ᴑ̨̨̍̆͞͡ ͦ̆ ॑ᵓ̩̗̍【列表项。】 19 | 【有序列表。】 20 | 【引用 唯一名称:「备注一」 类:「类一」】 21 | 避免了 在手写中文正文网页代码时不断切换输入法状态 来输入【代码】&lt;【代码。】和【代码】&gt;【代码。】。 22 | 【引用。】 23 | 【引用 唯一名称:「备注二」】 24 | 标题上 你可以使用「大标题」、「标题一」等多个意义相同的中文标签名,但要注意尽量避开【】这两个符号的使用,使用括号时推荐使用更加能体现中文波大茎深的【代码】「【代码。】以及 【代码】」【代码。】符号 25 | 【引用。】 26 | 【引用 唯一名称:「备注三」】 27 | 配合易网页指定样式表时,易网页会把中文标签改为标签相应的 【着重】类【着重。】 名,所以还是需要在表达式中使用类表达式。 28 | 【引用。】 29 | 【引用 唯一名称:「备注四」】 30 | 有什么不懂的其实直接看下当前网页的源代码就好啦~ 31 | 【引用。】 32 | 33 | 34 | 【二标题】增加【删除】两【删除。】一种中文结束语法【二标题。】 35 | 【时间】2015-08-31【时间。】 36 | 【有序列表】 37 | 【列表项】原有的【代码】【&#x3001;标签中文名】【、代码】结束语法;【、列表项】 38 | 【列表项】新增的【代码】【&#x6807;签中文名&#x3002;】【代码。】结束语法。【列表项。】 39 | 【列表项】【删除】新增的【代码】【 结束 】【代码。】结束语法。【删除。】【列表项。】 40 | 【有序列表。】 41 | 42 | 43 | 【二标题】增加两种「闭合任意标签」标示符【二标题。】 44 | 【时间】2016-01-31【时间。】 45 | 46 | 【有序列表】 47 | 【列表项】通过【代码】【&#x3001;】【、代码】、【代码】【&#x3002;】【代码。】标示符,可「闭合前一个打开的标签」。【列表项。】 48 | 【有序列表。】 49 | 【段落】感谢 【超链接 目标:「https://github.com/Arthur2e5」 方式:「新窗口」】@Arthur2e5【。】 的 Issues 【超链接 目标:「https://github.com/itorr/e/issues/4」 方式:「新窗口」】https://github.com/itorr/e/issues/4【超链接。】【。】 50 | 51 | 52 | 【列表 类「引用列表」】 53 | 【列表项】 54 | 【超链接 目标:「https://en.wikipedia.org/wiki/Standard_Generalized_Markup_Language#SHORTTAG」 方式:「新窗口」】Standard Generalized Markup Language - Wikipedia, the free encyclopedia【。】 55 | 【。】 56 | 【列表项】 57 | 【超链接 目标:「https://www.w3.org/blog/2007/10/shorttags/」 方式:「新窗口」】SHORTTAGS – THE ODD SIDE OF HTML 4.01【。】 58 | 【。】 59 | 【列表项】 60 | 【超链接 目标:「https://www.w3.org/TR/html401/appendix/notes.html#h-B.3.7」 方式:「新窗口」】Appendix B: Performance, Implementation, and Design Notes【。】 61 | 【。】 62 | 【列表。】 63 | 【标题二】男同性恋集线器 交流平台地址【标题二。】 64 | 【引用】 65 | 【超链接 目标:「http://github.com/itorr/e」 方式:「新窗口」】http://github.com/itorr/e【超链接。】 66 | 【引用。】 67 | 【尾部】 68 | 【图像 类:「二维码」 地址:「http://ww4.sinaimg.cn/large/a15b4afegw1evl6fnyss1j205k05kdg3」】 69 | 【尾部。】 70 | 71 | 72 | 75 | -------------------------------------------------------------------------------- /易网页.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .头部{ 4 | text-align:center; 5 | padding:1em; 6 | } 7 | .大标题{ 8 | font-size:3em; 9 | } 10 | .着重{ 11 | font-weight:800; 12 | } 13 | .大标题:before{ 14 | content:'「' 15 | } 16 | .大标题:after{ 17 | content:'」' 18 | } 19 | .引用{ 20 | text-indent:1em; 21 | background:#F8F8F8; 22 | padding:1.5em; 23 | margin:1em 0; 24 | position:relative; 25 | } 26 | .引用:before{ 27 | content:attr(id); 28 | position:absolute;top:.2em;left:.4em; 29 | color:#999; 30 | font-size:12px; 31 | text-indent:0; 32 | } 33 | 34 | .标题二{ 35 | margin:2em 0 0; 36 | } 37 | .段落{ 38 | text-indent:1em; 39 | } 40 | .有序列表{ 41 | padding:1em 2em; 42 | } 43 | .列表项{ 44 | padding:.5em; 45 | } 46 | .头部 .副标题{ 47 | color:#999; 48 | } 49 | 50 | .源代码{ 51 | background:#222; 52 | color:#FFF; 53 | } 54 | .代码{ 55 | background:#EEE; 56 | color:#666; 57 | text-shadow:0 1px 0 #CCC; 58 | padding:.2em .5em; 59 | margin:0 .5em; 60 | border-radius:.3em; 61 | } 62 | .删除{ 63 | opacity:.3; 64 | font-size:.8em; 65 | margin:0 -.3em; 66 | } 67 | .尾部{ 68 | padding:2em; 69 | } 70 | .二维码{ 71 | width:100px; 72 | height:100px; 73 | margin:0 auto; 74 | display:block; 75 | } 76 | 77 | .时间{ 78 | font-size:.8em; 79 | color:#999; 80 | } 81 | 82 | .引用列表{ 83 | font-size:.8em; 84 | } 85 | .引用列表 .列表项{ 86 | padding:.2em; 87 | } 88 | 89 | body{ 90 | max-width:38em; 91 | margin:0 auto; 92 | } -------------------------------------------------------------------------------- /易网页.js: -------------------------------------------------------------------------------- 1 | var 易网页=function(){ 2 | var 3 | 预转换标签={ 4 | '如何做爱':'html', 5 | '大标题':'h1', 6 | '标题一':'h1', 7 | '副标题':'h2', 8 | '标题二':'h2', 9 | '二标题':'h2', 10 | '标题三':'h3', 11 | '三标题':'h3', 12 | '标题四':'h4', 13 | '标题五':'h5', 14 | '标题六':'h6', 15 | '标题七':'h7', 16 | '块':'div', 17 | '段落':'p', 18 | '文本':'span', 19 | '着重':'strong', 20 | '引用':'blockquote', 21 | '删除':'del', 22 | '头部':'header', 23 | '尾部':'footer', 24 | '源代码':'pre', 25 | '代码':'code', 26 | '列表':'ul', 27 | '无序列表':'ul', 28 | '有序列表':'ol', 29 | '列表项':'li', 30 | '链接':'link', 31 | '网页标题':'title', 32 | '超链接':'a', 33 | '图像':'img', 34 | '样式':'style', 35 | '样式表':'link rel="stylesheet"', 36 | '脚本':'script', 37 | '框架':'iframe' 38 | }, 39 | 预转换参数名={ 40 | '唯一名称':'id', 41 | '类':'class', 42 | '目标':'href', 43 | '地址':'src', 44 | '关系':'rel', 45 | '方式':'target' 46 | }, 47 | 已打开的标签们=[], 48 | 转换=function(文本){ 49 | return 文本.replace(/(【[。、]】)|(【)(、?)([\u4e00-\u9fa5]+)(。?)(.*?)(】)/g,function(整段文本,强制闭合,开始标签,是否结束标签,中文标签名,是否结束标签二,参数字段,结束标签,预输出的标签名,长度){ 50 | if(强制闭合) 51 | return '' 52 | 53 | 预输出的标签名=预转换标签[中文标签名]||'div' 54 | 55 | if(!(是否结束标签||是否结束标签二)){ 56 | 已打开的标签们.push(预输出的标签名) 57 | return '<'+预输出的标签名+' '+参数字段转换(参数字段,中文标签名)+'>' 58 | }else{ 59 | 长度=已打开的标签们.length+1 60 | while(已打开的标签们[--长度]!=预输出的标签名); 61 | 62 | 已打开的标签们.splice(长度,1) 63 | 64 | return '' 65 | } 66 | }) 67 | }, 68 | 参数字段转换=function(参数字段,中文标签名){ 69 | 参数字段=参数字段.replace(/([\u4e00-\u9fa5]+?):?「(.+?)」/g,function(整段文本,中文参数名,值,预输出的参数名){ 70 | 预输出的参数名=中文参数名 71 | 72 | if(预转换参数名[中文参数名]) 73 | 预输出的参数名=预转换参数名[中文参数名] 74 | 75 | if(预输出的参数名=='class') 76 | 值=中文标签名+' '+值 77 | 78 | return 预输出的参数名+'="'+值+'"' 79 | }) 80 | 81 | if(!参数字段.match(/class/)) 82 | return 参数字段+=' class='+中文标签名 83 | 84 | return 参数字段 85 | }, 86 | 变身=function(网页标签){ 87 | if(!(网页标签=网页标签.getElementsByTagName('xmp'))) 88 | return console.log('请在标签内通过标签包裹易网页语言') 89 | 90 | 网页标签.innerHTML=转换(网页标签[0].innerHTML) 91 | } 92 | 93 | return { 94 | 转换:转换, 95 | 变身:变身 96 | } 97 | }() 98 | --------------------------------------------------------------------------------