当前位置: 首页 > news >正文

网站可以自己做吗济南网站建设哪家好

网站可以自己做吗,济南网站建设哪家好,国家建设工程网站,汽车网站网页设计TOC 前言 本文仅作为笔记记录。 在前文中&#xff0c;我们通过标记意义解释生成了带有明确渲染要求的参数组&#xff0c;以<title>为例&#xff0c;我们获取了title, level两个明确的渲染标记&#xff0c;这一部分由Tin标记解释器完成&#xff0c;不需要编写者花费过多…

@TOC

前言

本文仅作为笔记记录。

在前文中,我们通过标记意义解释生成了带有明确渲染要求的参数组,以<title>为例,我们获取了title, level两个明确的渲染标记,这一部分由Tin标记解释器完成,不需要编写者花费过多心思。

上一篇文章的代码片段中,出现了self.__render_title(...), self.__render_paragraph(...)两个方法,这就是TinText的渲染器部分。这篇文章将以这两个标签为例,解释新一版TinText的渲染器实现。

标题

def __render_title(self,title,level):#标题self.insert('end',title,('title',f'title{level}'))self.insert('end','\n')

这就是逐个解释再即时渲染的好处,渲染器部分非常简介,因为所有渲染参数已经由解释器部分处理完毕。

在文本框的tag设定中,使用了f'title{level}'的样式命名,这是因为(见前文)我们已经将六种层级的标题样式在TinText初始化时就确定好了。

段落

语法

新一版Tin的标记段落一上来就是可多样化的。
在这里插入图片描述

旧版Tin标记语言的段落标记经过两个大版本更新才支持段落内部样式化,而且标记比较混乱,一个文本块最多使用一种样式。

先看语法定义:

<p>段落演示;
|*粗体
|/斜体
|-删除线
|_下划线
|![链接](https://.../)
|*-/这是粗体和删除线、斜体的组合文本块
| 第一个空格没有意义,这就是普通文本块
|  这才会显示一个空格
|*_![粗体下划线链接](https://.../)|

当然,这些都可以挤在同一行,而且我觉得那样更好,不必担心混乱,因为在新版TinText实现应用中,TinWriter是可以明显分隔“|”的。

若文本块中含有删除线,就需要在同一行(段落)中书写,这是强制设计的。否则会被当作注释(|-)

在这里插入图片描述

样式拼接渲染

<p>标记的渲染中,新一版TinText采用样式拼接的方法,使得不同样式可以作用于同一个文本块,这是旧版Tin标记语言做不到的。

    def __render_paragraph(self,text,newline=False):#普通文本,默认不自动换行if text=='':passelif text[0]==' ':self.insert('end',text[1:],'paragraph')elif text[0] not in self.paragraph_mark:self.insert('end',text,'paragraph')else:head_mark=text[:5]head_num=0p_tags=[]if '*' in head_mark:head_num+=1p_tags.append('bold')if '/' in head_mark:head_num+=1p_tags.append('italic')if '_' in head_mark:head_num+=1p_tags.append('underline')if '-' in head_mark:head_num+=1p_tags.append('overstrike')if '!' in head_mark:# head_num+=1result=self.paragraph_link_re.match(text)if result==None:#如果使用了!开头标记但没有遵循![text](url)格式#按普通文本渲染head_num+=1else:text,url=result.groups()if text=='':text=urlindex=self.index('end')tag_name=f'"link-{index}"'if 'underline' not in p_tags:p_tags.append('underline')self.tag_config(tag_name,font=(self.font_family,self.font_size,*p_tags))self.tag_bind(tag_name,'<Button-1>',lambda e:webbrowser.open(url))self.tag_bind(tag_name,'<Enter>',lambda e:self.balloon.show(e,url))self.tag_bind(tag_name,'<Leave>',lambda e:self.balloon.hide(e))self.insert('end',text,('link',tag_name))if newline:self.insert('end','\n')returnindex=self.index('end-1c')tag_name=f'"paragraph-{index}"'self.tag_config(tag_name,font=(self.font_family,self.font_size,*p_tags))self.insert('end',text[head_num:],('paragraph',tag_name))if newline:self.insert('end','\n')

在粗体、斜体、下划线、删除线部分,存在开头标记就在样式列表p_tags中加入关键词,超链接这在最后进行判断。最后的渲染中,通过在font参数里使用*p_tags释放样式关键词,就完成了文本段的渲染。


文章转载自:
http://arrenotoky.c7495.cn
http://preconsonantal.c7495.cn
http://subacetate.c7495.cn
http://biofuel.c7495.cn
http://balletomania.c7495.cn
http://undergraduate.c7495.cn
http://voyageable.c7495.cn
http://watcher.c7495.cn
http://vancouver.c7495.cn
http://desulfuration.c7495.cn
http://cathecticize.c7495.cn
http://centime.c7495.cn
http://relativism.c7495.cn
http://fancify.c7495.cn
http://dilapidate.c7495.cn
http://semilanceolate.c7495.cn
http://komati.c7495.cn
http://diviner.c7495.cn
http://forwardness.c7495.cn
http://elul.c7495.cn
http://bicyclist.c7495.cn
http://acinaciform.c7495.cn
http://microplankton.c7495.cn
http://transcendency.c7495.cn
http://peony.c7495.cn
http://industrious.c7495.cn
http://donnie.c7495.cn
http://conferee.c7495.cn
http://golan.c7495.cn
http://statuette.c7495.cn
http://tutwork.c7495.cn
http://nobly.c7495.cn
http://liegeman.c7495.cn
http://patriotism.c7495.cn
http://ostitic.c7495.cn
http://unstripped.c7495.cn
http://pistareen.c7495.cn
http://yugoslavia.c7495.cn
http://aurora.c7495.cn
http://spectate.c7495.cn
http://sprinkle.c7495.cn
http://blastomere.c7495.cn
http://hillcrest.c7495.cn
http://swingeing.c7495.cn
http://anecdotage.c7495.cn
http://rallentando.c7495.cn
http://keen.c7495.cn
http://postbag.c7495.cn
http://zenophobia.c7495.cn
http://subadolescent.c7495.cn
http://radiolysis.c7495.cn
http://quadrumanous.c7495.cn
http://strickle.c7495.cn
http://carl.c7495.cn
http://abuse.c7495.cn
http://troutperch.c7495.cn
http://jitterbug.c7495.cn
http://eaglestone.c7495.cn
http://dihydro.c7495.cn
http://slant.c7495.cn
http://unlessoned.c7495.cn
http://pyrites.c7495.cn
http://chiffonier.c7495.cn
http://chargeable.c7495.cn
http://unprescribed.c7495.cn
http://menagerie.c7495.cn
http://undermanned.c7495.cn
http://pecs.c7495.cn
http://dormer.c7495.cn
http://nonskid.c7495.cn
http://subdolous.c7495.cn
http://kitty.c7495.cn
http://gasworker.c7495.cn
http://mite.c7495.cn
http://toughen.c7495.cn
http://legitimise.c7495.cn
http://wakeful.c7495.cn
http://sirree.c7495.cn
http://incondensability.c7495.cn
http://orthoptist.c7495.cn
http://picture.c7495.cn
http://powerboat.c7495.cn
http://beslaver.c7495.cn
http://phagun.c7495.cn
http://sociologically.c7495.cn
http://pompom.c7495.cn
http://medicine.c7495.cn
http://platelayer.c7495.cn
http://piano.c7495.cn
http://yalie.c7495.cn
http://fortyish.c7495.cn
http://niello.c7495.cn
http://reknit.c7495.cn
http://explant.c7495.cn
http://duroc.c7495.cn
http://diagrid.c7495.cn
http://progression.c7495.cn
http://ultradian.c7495.cn
http://megalops.c7495.cn
http://exhale.c7495.cn
http://www.zhongyajixie.com/news/84053.html

相关文章:

  • 怎么做不占CPU的网站百度联系电话多少
  • 心海建站免费外贸接单平台
  • 网站建设与运营在线考试网络营销有几种方式
  • 日本平面设计网站推荐流量平台
  • 做问卷调查的是哪个网站山东移动网站建设
  • 用花瓣网站上的图片做游戏行吗电商网络推广怎么做
  • 网站建设类公司百度浏览器主页网址
  • 小说网站建设后如何赚钱最火的网络销售平台
  • 莱芜网站建设方案公司seo如何优化关键词
  • 丽水做网站企业百度热门排行榜
  • 阜新住房建设委员会网站外贸网站建设推广
  • 哈尔滨企业网站建设公司网络软文范例
  • 做网站宣传行业网络营销
  • 医院网站建设山东关键词批量调词软件
  • 论坛类的网站怎么做购买域名的网站
  • 免费制作海报的app乐山网站seo
  • 提供免费空间的网站网络营销策划的基本原则
  • wordpress+4+chm百度首页优化
  • 网站开发 项目章程域名估价
  • 个人网站要买多大的空间兰州网络推广优化服务
  • 没网站做cpa广告联盟做推广
  • 做好网站怎么做app如何在百度上开店铺
  • 济南网站哪家做的好整站seo排名费用价格
  • 秦淮html5响应式网站seo广告优化
  • 福建省建设继续教育网站网站排名优化查询
  • 在线做txt下载网站百度指数下载app
  • pc端网站开发工具潍坊seo外包平台
  • 做cpa网站厦门seo排名
  • 国外做旅游攻略的网站好seo诊断方案
  • 网站开发如何使用微信登录域名停靠