如何在重构文本中将文字块与块引用分开?

时间:2017-09-27 22:44:24

标签: restructuredtext

例如,如果我有:

  QTextDocument* pDocument = mpTextEdit->document();
  QTextCursor cursor(pDocument);

  QFont defaultFont("Calibri", 12);
  pDocument->setDefaultFont(defaultFont);
  QString str = "<h1>Hello, World!</h1>
  str += "<br/>";
  str += QString("名称不能为空。");
  str += "<br/>";
  str += "ABC";
  str += "</p>";
  pDocument->setHtml(str);

// Print to .pdf
QPrinter printer(QPrinter::PrinterResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setPaperSize(QPrinter::A4);
printer.setOutputFileName("c:/temp/foo.pdf");
printer.setFontEmbeddingEnabled(true);
pDocument->setPageSize(printer.pageRect().size()); 
pDocument->print(&printer);

假设blockquote是文字代码块的一部分。有没有办法表明这些是单独的块?

1 个答案:

答案 0 :(得分:1)

使用pull-quote directive

.. code:: python

    import os
    this_is_the_last_code_line = 5

.. pull-quote::

    Now I want this text to be a blockquote.