yuwan
V2EX  ›  问与答

如何格式化 jade 输出的 html 代码

  •  
  •   yuwan · Jul 28, 2014 · 6207 views
    This topic created in 4481 days ago, the information mentioned may be changed or developed.
    用harp做静态服务器,用jade写html ,用less写css ,配合smartF5,调试那叫一个方便,速度杠杠的,当把html制作成wordpress主题时,问题来了,发现jade输出的html ,只有一行!!
    搜索无果,特来请教大大们
    9 replies  •  2014-07-29 15:43:30 +08:00
    47jm9ozp
    47jm9ozp
    Jul 29, 2014❤️1
    1
    $ jade --help

    Usage: jade [options] [dir|file ...]

    Options:

    -h, --help output usage information
    ...
    -P, --pretty compile pretty html output
    ...
    jsonline
    jsonline
    Jul 29, 2014❤️1
    2
    楼上真相。
    楼主很少用命令行么?
    keefo
    keefo
    Jul 29, 2014❤️1
    3
    我也因为这个原因放弃jade了,本来就很熟悉html的话,没必要用jade。
    keefo
    keefo
    Jul 29, 2014
    4
    handlebar 代替 jade
    stylus 代替 less
    paloalto
    paloalto
    Jul 29, 2014 via iPhone❤️1
    5
    记得是把wrap设为none或者false
    yuwan
    yuwan
    OP
    Jul 29, 2014
    6
    @ooxxcc @jsonline 感谢回复,只是 harp.js 输出html 的方法是 harp compile ,
    用 jade 命令,不能处理部件,需要把分割的部件重新放回去,比如header.jade 、footer.jade,
    yuwan
    yuwan
    OP
    Jul 29, 2014
    7
    @keefo 谢谢关注, 有空试一下handlebar ,stylus
    yuwan
    yuwan
    OP
    Jul 29, 2014
    8
    @paloato 没有此选项 ,harp 命令或者 jade
    otakustay
    otakustay
    Jul 29, 2014
    9
    HTML就一行,但dev tool里DOM树结构还是对的,不影响调试啊……真看着HTML这么个字符串调试的?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1901 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 16:36 · PVG 00:36 · LAX 08:36 · JFK 11:36
    ♥ Do have faith in what you're doing.