เราจะเปลี่ยนสีพื้นหลังของโค้ดอินไลน์ได้อย่างไร
วิธีหนึ่งที่ฉันใช้โค้ดอินไลน์ในข้อความที่ปรับโครงสร้างใหม่คือ:
.. role::sql(code)
:language: sql
You can use the query :sql:`select * from table` to execute...
เมื่อใช้ rst2pdf
มันจะแสดงผลการเน้นไวยากรณ์ที่สวยงามและสีพื้นหลังเหมือนกับบล็อกโค้ด เราจะบรรลุเป้าหมายเดียวกันโดยใช้ rinohtype
ได้อย่างไร
ตามหลักการแล้ว that looks like this in stackoverflow
นี่คือสิ่งที่ฉันลองด้วยตัวเอง
stylesheet:
[code-paragraph: Paragraph(has_class="coder")]
background_color = #fdffd6
and rst:
.. role::sql(code)
:language: sql
:class: coder
You can use the query :sql:`select * from table` to execute...
แต่วิธีนี้ใช้ไม่ได้ เนื่องจาก role
อาจเป็นข้อความไม่ใช่ย่อหน้า
..role::
- person Brecht Machiels   schedule 29.01.2021