Coder Social home page Coder Social logo

Standardized formatting methods about docx HOT 6 CLOSED

dolanmiu avatar dolanmiu commented on May 14, 2024 1
Standardized formatting methods

from docx.

Comments (6)

dolanmiu avatar dolanmiu commented on May 14, 2024

Right now there are multiple places

but .bold() and .font(fontName: string) can only be called from Run though. I don't fully understand

from docx.

felipeochoa avatar felipeochoa commented on May 14, 2024

Yeah that's precisely the issue. Paragraph.bold() should work, since DOCX allows setting the property paragraph-wide; ditto tables. We should also have RunStyle object with a .bold() method, and should add it to ParagraphStyle

from docx.

dolanmiu avatar dolanmiu commented on May 14, 2024

Does the office xml documentation even allow applying bold to paragraphs?

I assumed all that stuff was only available to the run. I could be (and hope that I am) wrong!

from docx.

felipeochoa avatar felipeochoa commented on May 14, 2024

I could have sworn there was an element for "paragraph run-style properties", but looking through the spec now it looks like I was wrong! I think I just got confused with the paragraph styles, which do indeed have a separate section for run-styles. So you can, e.g., define ListParagraph to be indentend and bold.

from docx.

dolanmiu avatar dolanmiu commented on May 14, 2024

If bold is only available in the run, we would in future make .bold() in the Paragraph object which manually adds bold to all the Runs, which will make it less tedious for the user

Otherwise the user would have to .bold() every time, which might not be fun

But this is non-priority though, I don't see much reason for a user to bold an entire paragraph, it will look weird maybe 😂 . I don't think I've ever needed to bold an entire paragraph in any essay/dissertation I wrote

from docx.

dolanmiu avatar dolanmiu commented on May 14, 2024

Closing, stale

from docx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.