标记语言代替 HTML

发布于 2024-11-19 07:10:08 字数 437 浏览 3 评论 0原文

我正在构建一个网站,但不想编写任何 HTML(或 XML)。我想我可以使用更好的标记语言来代替。

我研究过 MarkdownreStructuredText,但它们不支持我需要的所有 HTML“功能”。我可以使用任何标记语言来代替编写大量复杂的 HTML,还是我需要自己发明一些东西? (我正在寻找Python中可用的东西)

编辑

我想创建具有任意内容(嵌套、随机属性等)的任意HTML结构。另外,表的简单可读语法也很好。

在术语“友善”下,我的意思是:我希望它更具人类可读性(更少的繁琐)和更少的冗长(更少的打字)。缩进而不是手动关闭标签会很好。

EDIT2

我不想替换 H​​TML:我只是想编写其他内容,然后在运行时转换为它。

I'm building a website, but don't want to write any HTML (or XML). I was thinking that I could use a nicer markup language instead.

I've looked at Markdown and reStructuredText, but they don't support all the HTML "features" I need. Are there any markup languages that I could use instead of writing a lot of intricate HTML, or do I need to invent something myself? (I'm looking for something available in Python)

EDIT

I want to create arbitrary HTML structures with arbitrary content (nesting, random attributes, etc.). Also a simple readable syntax for tables would be nice.

Under the term niceness I mean: I want it to be more human readable (less crud) and less verbose (less typing). Indenting instead of manually closing tags would be nice.

EDIT2

I wasn't looking to replace HTML: I just wanted to write something else and then convert to it at runtime.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

因为看清所以看轻 2024-11-26 07:10:08

据我所知,除了 HTML 之外,用其他语言编写实际网站结构标记的替代方案并不多。

我唯一听说过的是 Haml,HTML 抽象标记语言。它是一种简短的标记语言,可以直接转换为 HTML 标记,所以也许值得一看?

我能想到的唯一的其他选择是使用 XSLT 和 HTML 的某种可怕的混合体,我认为这除了让你的大脑受伤之外没有任何好处。

As far as I know, there aren't really many alternatives for writing actual website structural markup in other languages than HTML.

The only thing that I've heard of is Haml, HTML Abstraction Markup Language. It's a short and concise markup language which translates directly into HTML markup, so perhaps it's worth a look?

The only other option I can think of is using some sort of monstrous hybrid of XSLT and HTML, which I don't think is any good at all except for making your brain hurt.

弱骨蛰伏 2024-11-26 07:10:08

如果没有 HTML,您就无法构建一个可用的网站,因为该实现不在 Firefox、Chrome 等浏览器内部。Markdown 和 reStructuredText 只是标记语法处理器(就像 BBCode 一样)。

现在谈谈其他好东西。如果你想使用Python构建一个动态网站,你可以使用Django(这是一个Python Web框架)。 Django 书籍Django 文档

然而,Django 确实有一个模板系统,它确实使 HTML 编码变得更好(TONS 更好)。

要学习 HTML 和 JS,我建议使用 W3Schools。不过警告!他们的一些信息不完整且不准确(请参阅 W3Fools 了解这一点)。

You can't build a working website without HTML, seeing as the implementation isn't inside browsers like Firefox, Chrome, etc. Markdown and reStructuredText are simply markup syntax processors (just like BBCode for example).

Now on to the other good stuff. If you want to build a dynamic website using Python, you can use Django (which is a Python web framework). The Django book should also help you out a lot, in conjunction with the Django documentation.

Django DOES have a templating system which does make HTML coding nicer (TONS nicer) however.

To learn HTML and JS, I suggest using W3Schools. Warning though! Some of their information IS incomplete and inaccurate (see W3Fools for this).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文