yuwan
V2EX  ›  问与答

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

  •  
  •   yuwan · Jul 28, 2014 · 5837 views
    This topic created in 4333 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
        1
    47jm9ozp  
       Jul 29, 2014   ❤️ 1
    $ jade --help

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

    Options:

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