-
Notifications
You must be signed in to change notification settings - Fork 68
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
Assorted changes and a couple of fixes to the fancy sheets #147
base: master
Are you sure you want to change the base?
Conversation
66e38c8
to
93c173c
Compare
Hi there, @PJBrs ! Regards, |
Hi @bw-mutley! Thanks! I think most of the more structural changes apply to the features pages, hardly any to MSavaga's style. I've tested both though. If you have any suggestions though for continuing this PR, please let me know. In the meantime, I've added one more substantial change that renders the monster blocks more in keeping with the RPGTex D&D style. Problem is, my repo now is one long list of assorted changes, including spelling fixes, small additions, small enhancements and substantial formatting changes that affect how everything looks... I'm force-updating the PR now, and then I'll see whether I can sort it better. In the meantime, any suggestion at all would be appreciated! |
So, I sorted all my patches. The first five patches are trivial spelling and whitespace fixes.
The "Fix" pdfbookmarks patch does not fully work, but as far as I can tell, it's less error-prone than the current behaviour. The next five patches all represent small enhancements:
All the remaining patches offer rather substantial changes that I personally like, and I hope for some feedback on them. These two patches sort spells by name and level and add headings for each spell level in the features pages:
These two patches sort feats by origin and level (character feats, class feats, background feats and racial feats) and add associated headers in the feature pages:
I tried to write these trying not to be invasive and ended up doing quite a lot of pattern matching in latex. Could have done them simpler. The final two patches all concern relatively minor aesthetic changes that I liked:
Basically, I'm looking for comments on all of these, regarding:
|
exactly how my local files are at the moment. I've made several additions and corrections too, but can't keep track of everything in commits like you did - seens like I have a lot to learn on how to keep with people here. To properly contribute again, I will - at some point - have to dowload the master branch again. I've seen many issues in my local files which were probably fixed. |
Hi, @PJBrs. Apologies for the slow response. My day job got unexpectedly chaotic. Thank you for all the hard work and for organizing these commit in a useful way. I will take a closer look when things calm down a little bit and I get my feet back underneath me. |
Hi @canismarko , take your time! By now it should be clear that I couldn't help myself anyway :-) I think, given all patches I now added, the majority should be sufficiently palatable, but others also represent design choices that you might disagree with, and then there's the matter of whether my implementations are agreeable, aside from their effects. I hope things will calm down soon! |
@canismarko I noticed you triggered some tests. The latex ones fail because of the changes I made. The below patch adapts the tests to my other patches (and makes them pass). I'll look into the other failing tests another time.
|
I added the test I posted previously in the comments. Also, I reordered the new patches a bit to leave the DND-monster formatting at the end. I tested all monsters I could, made many formatting fixes as well, only remaining thing is to add bulleted lists. And I wrote one more patch to enable DND-tables throughout, after I conjured up a regex that translated docutil's supertabular table header to a dndtable header. Next step is probably to see if I can improve any table I find. |
697e974
to
0f3fedb
Compare
Rewrote the monster formatting patch. I think it now is on par with, or better than regular latex. I don't think I really have anything else to add anymore. I didn't test all tables, but, in any case, the dndtables are less wide than the regular ones, so any text overflow will have been present anyway, and might be prevented now. If necessary, I can upload some example character sheets... Would that help? I did notice some potential enhancements, such as putting lair actions of dragons in a separate heading, just like aboleth, as well as formatting the breath weapons a bit more (\emph{breath weapon}). All that would be rather easy. And one bug, perhaps, I can't seem to add certain monsters as companions, e.g.: EDIT Let's let this sit here for a while, while I test more... Just force-updated because I clobbered one of my previous fixes. ;'-) EDIT 2 - 13 feb Fixed a small bug in the dndtable header regex. |
28359ec
to
85c9506
Compare
@canismarko @bw-mutley @canismarko How might I make this PR easier to review? I can, for instance, make separate PRs for different groups of patches, for instance as follows:
@bw-mutley Perhaps you'd be interested to take a look at the various patches that deal specifically with the MSavage style sheet? Finally, I tried to run the dungeonsheets tests, which complain about some missing html pages, but the latex tests complete fine:
|
Hi there, @PJBrs , sorry for the late reply.
Thanks for the contribution. I will fork your branch and try to do it this week. |
@bw-mutley Great! Let me know if you need the MSavage style sheet changes in a separate branch... |
Hi there, PJ! Only now I could have some spare time to work on it. I've made a small comment about the sorcerer -> sorceror change, please take a look. About the MSavagesheet: I will need some more time since I've changed my PC and ended missing some tex files needed. |
Hi @bw-mutley I thought sorceror was the correct spelling, but indeed, not only the PHB but also standard dictionaries prefer sorcer_er_. I wonder whether we should revert or reverse that spelling patch ;) |
I suppose it is up to @canismarko to decide. But my suggestion is to push a PR fixing all 'sorceror' ocurrences into 'sorcerer'. |
Previously, spells were one long list organised alphabatically. This patch makes it possible to either sort spells alphabetically or by level (and then alphabetically within each level). The patch implements this feature using command-line options. Either the user can specify --spell-order or -S to order by level and name. Default is alphabetical order. Furthermore, this patch removes two places in character.py in which spells were ordered, but the resulting order wasn't used anywhere anyway.
This patch adds a subsection for each spell level when the user has selected to order spells by level. The patch keeps count of the spell level and adds a new header with every increase of spell level in the list of spells (i.e., headers like: Cantrips; 1st Level Spells; 2nd Level Spells, and so on). Add a test as well to check that the right spell headers also show up for the spells sorted by level.
This patch documents the makesheets commandline option to order spells by level.
This patch gives the option to sort feats by type instead of alphabetically. Basically, it just adds the feats in the same order that dungeonsheets finds them, which goes from character feat to class feats to racial feats to background feats. The patch implements this feature using a command-line option. The user can specify --feats-by-type or -N to order feats by type. Default is alphabetical order. Also, remove the explicit treatment of fighting styles from character.py. It's not necessary anymore since fighting style is now a feature selector.
If the user has selected to order feats by type, this patch adds headers for each feat type instead of one Features heading. Headers include Character Feats (if applicable), Class Feats, Racial Feats and Background Feats.
This patch enables additional sorting for features that are classes of other features. This works as is for metamagic, in the sense that it sorts all metamagic options under the metamagic feature, by checking whether a metamagic option is the direct child of the Metamagic class. The same is intended for other feature options. The intended relations are: Bloodhunter: Rites --> CrimsonRites BloodCurses --> BloodMaledict Formulas --> Formulaa Fighter: Maneuver --> CombatSuperiority TrickShot --> AdeptMarksman Warlock: Invocation --> EldritchInvocation However, these need some additional work to lay the right class relations.
Make the Maneuver class an alias to CombatSuperiority, so that Battle Master Maneuvers can be easily sorted as instances of CombatSuperiority.
Allow the player choices for Trick Shots of the Gunslinger Fighter subclass to be sorted as instances of AdeptMarksman, by aliasing AdeptMarksman as TrickShot and by making all Trick Shot features an instance of TrickShot
Allow Invocations to be sorted under the Eldritch Invocations feature by aliasing the EldritchInvocation class as Invocation.
This patch aliases Rites to CrimsonRites and BloodCurses to BloodMaledict, so that all rites can be sorted under the Crimson Rites feat, and all the blood curses under the Blood Maledict feat. Furthermore, it integrates the two Formulas classes.
Document the makesheets commandline option to sort features by type.
The feature pages start with page number one. This patch keeps count of the number of pdf pages written _before_ the feature pages and then starts with the number after that. For most characters, this is 4, but 3 characters without spells.
The equipment box on the MSavage latex template still quite easily overflows. Previously, this was in part due to the fact that weight and carrying capacity both occupied a single line in the equipment box. This patch puts weigt and carrying capacity on a single line by displaying it in a smaller font size and by rounding weight to whole numbers instead of two decimals.
This patch prevents the portrait picture in the MSavage latex template to overflow the appearance box. It centers the portrait if it doesn't fill the width of the appearance box. And it keeps compatibility of having both text and an image in the portrait box.
Previously, the MSavage latex template did not scale font size in order to fit text inside specific spaces, which meant that the levels and classes of a multiclass character would overflow the text space for level and class. With the current template, we can list all classes and levels. Best tested with the sorcerer_ranger.py example.
The fillable forms list requirements for every spell. For the latex template, this is a little bit harder because you need to escape the dollar sign $ for valuable components. This patch does exactly that.
The fillable pdf format has overflow sheets for when the number of spells exceeds the number of spells for one spell page. This patch implements such overflow sheets for the latex character sheets.
This patch adds the MSavage latex template as a submodule to dungeonsheets, adds it to the TEXINPUTS environment and adds TTFONTS environment variable to find the kalam font. Furthermore, make the MSavage latex template part of the tests in the github workflow. Remove babel support from the MSavage latex template, otherwise latex will complain about missing languages (alternatively, we could add the languages directory from the dnd class to pyproject.toml). The latest version of the MSavage latex template adds automatic text scaling so that text fields no longer overflow with longer inputs. This fixes canismarko#92
The MSavage latex template was compiled using xelatex. To make this work, an additional setting had to be used for dvipdfmx.cfg (-dNOSAFER), which represents a (slight) security risk. Furthermore, xelatex is very slow. This patch switches to lualatex instead. It has different dependencies, the most important one being the presence of luapstrics.lua. As far as I can tell, by now luapstricks.lua should be present on your average system with TexLive. It is on mine, at least, on Slackware-15.0, which is moderately conservative in many respects.
Rename the MSavage latex template to the more generic latex_character_sheet_template.tex. I also renamed associated functions that still had the msavage name in them to more neutral alternatives. This on behalf of Mat Savage himself, who created the Latex 5e Character Sheet Template that we use in dungeonsheets.
This patch adds the makesheets commandline option to build the latex character sheet to the README.
Dungeonsheets now packages the dnd latex template and the dnd latex character sheet template packages as submodules. This greatly eases using the latex code, but it also takes away some opportunities for customisation. This patch checks whether dnd.sty and dndtemplate.sty are already installed in a local latex directory, and if so, adds them to the texinputs path used in the latex subprocess environment. I also changed the order in which the various latex packages are loaded in the MSavage latex format, so that, if necessary, a user can pass options to the dnd package by adding them to a locally checked out version of the dndtemplate. And it would be possible at a later change to switch the dndtemplate over to using tcolorbox with the fitting library instead of the custom fitbox code used now, in order to shrink font size and fit text within specific boxes on the character sheet.
This is a squashed commit of various changes by Mat Savage to improve upon the github tests. First, this patch updates the Docker file so that it is compatible with lualatex. Furthermore, it adds a test building all dungeonsheets examples in the docker workflow file. And it refactors the python_ci workflow by only testing all examples in python-3.12, to prevent the test runs from taking so long. Finally, it pushes the resulting docker image to the registry after tagging it "latest".
The Bloodhunter features had three duplicate feature classes: - Blood Curse of Corrosion - Blood Curse of the Exorcist - Blood Curse of the Souleater This patch integrates these duplicates.
This patch makes parsing options for a FeatureSelector more robust. First, it only compares selections with the keys of the FeatureSelector options dictionary, and second, it doesn't care whether developers have defined options lowercase or uppercase. In so doing, this fixes selecting a patron for the bloodhunter Order of the Profane Soul: The Bloodhunter Feature Selector for OtherwordlyPatron lists the options for the patron choices capitalised. However, the code in FeatureSelector expected them to be lowercased. Make the FeatureSelector not care about case.
Hi, I just found dungeon-sheets and I like it very much! I had been writing my character sheets by hand in latex using MSavage's style, but that isn't very automated.
I hope to contribute a little bit with a couple of ideas that are focused on the features pages. I think basically the patches speak for themselves, and for now I'd mainly like to get some reactions as to whether these patches are actually wanted, and perhaps what other / further directions to take with this.
I can also supply an example of the type of layout that I'm trying to achieve. I'm keeping a small wishlist of my own, with items like:
I should add that I can code only a little bit, but I tested the changes on all the example sheets.
Anyway, I really hope to hear whether this type of work is appreciated!