Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Bullet Slide #167

Open
yamsu opened this issue Sep 18, 2024 · 7 comments
Open

Non-Bullet Slide #167

yamsu opened this issue Sep 18, 2024 · 7 comments
Labels
difficult Things that are difficult to do - but not necessarily to be rejected enhancement New feature or request

Comments

@yamsu
Copy link

yamsu commented Sep 18, 2024

Great tool! Latex/Beamer for Powerpoint!

Not sure if this should be classified as an issue, but I can't figure out how to add non-bulleted paragraphs to a slide? Even a way to hide the bullets would be sufficient. Perhaps I need to use the new runpython framework. Has anyone done something like this before? Thanks in advance

@MartinPacker
Copy link
Owner

Thanks for the kind words. The issue here is that - until now at least - I've used non-bulleted to denote slide notes. A very early decision and possibly the wrong one.

So, yes, it should be an issue. 😀

It would be nice to be able to parse inline text as non-paragraph. Indeed I think that's what Agenda slides do - but that isn't an answer to your problem.

It should be possible to do it in Python - but I think that's not a user-friendly solution. (I might expose a function, though.)

One question: Could you alter your template to be bulletless? Probably not, but worthwhile my asking.

@MartinPacker MartinPacker added enhancement New feature or request difficult Things that are difficult to do - but not necessarily to be rejected labels Sep 18, 2024
@MartinPacker
Copy link
Owner

In the code - currently at line 909 - I see the following useful code:

def removeBullet(paragraph):
    pPr = paragraph._p.get_or_add_pPr()
    pPr.insert(
        0,
        etree.Element("{http://schemas.openxmlformats.org/drawingml/2006/main}buNone"),
    )


def removeBullets(textFrame):
    for p in textFrame.paragraphs:
        removeBullet(p)

Proves it's doable - but how to control it?

@MartinPacker
Copy link
Owner

I've prototyped RunPython.removeBullets and RunPython.removeBullet.

These are thoroughly subject to change. Probably to generalise them. So don't rely on them staying.

Anyhow pushed. No harm to anybody who doesn't call them. 😀

@yamsu
Copy link
Author

yamsu commented Sep 19, 2024

Terrific this works, adding an example for others:

### Thank You 

This is a thank you slide!
* Presentation for Fun
* By Author
	* Address
	* Contact Email
```run-python
RunPython.removeBullets(slide.shapes[-1])
```

There is a minor issue with run-python. The slide is divided into two content regions, and in this case, the second content region is left blank.

@MartinPacker
Copy link
Owner

Thank you for the sample. Whether it remains as a function in this form remains to be seen. There is the possibility of generalising it. Also of using metadata (including dynamic metadata) to control this.

But I'm inclined to leave these two functions in - as they're simple.

@MartinPacker
Copy link
Owner

I would use something like <!-- md2pptx: contentsplit: 1 0 --> to control the renderingRectangle dimensions reserved for runpython on this page. (Or similar at the top of the input file: contentsplit: 1 0.)

@MartinPacker
Copy link
Owner

Refactored removeBullet and removeBullets into paragraph.py.

Added removeSelectedBullets - in paragraph.py and runPython.py. Note: This uses zero-indexing for paragraph numbers. eg

RunPython.removeSelectedBullets(myTextbox, [0, 2])

removes the first and third bullets of the text box.

Externals via metadata will use 1-indexing.

Code pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficult Things that are difficult to do - but not necessarily to be rejected enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants