Skip to content

Commit 6778104

Browse files
committed
More tweaks to disk-saved file layout for appearance in Markdown / Commonmark viewers. Pretty happy with it now.
1 parent 8b82c9d commit 6778104

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

src/fn_view_npc_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn view_npc_block(npc_data: &Profile) -> String {
1919

2020
let ects = &npc_data.encounter_slots;
2121
text_block += &format!(
22-
"\n _[chance of being currently present (2d6): 10+ {} | 8+ {} | 9+ {}]_",
22+
"\n\n _[chance of being currently present (2d6): 10+ {} | 8+ {} | 9+ {}]_",
2323
ects[0].name.to_string(),
2424
ects[1].name.to_string(),
2525
ects[2].name.to_string()

src/tavern/implementations.rs

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub mod list {
1919
};
2020
use crate::tavern::structs::list::{App, PBHouse};
2121
use crate::tavern::traits::list::{AppFn, ToCapitalized};
22-
use crate::text_postproc::tpp::{enum_string_to_phrase, is_a_an, tidy, trim_whitespace};
22+
use crate::text_postproc::tpp::{enum_string_to_phrase, is_a_an, l1_heading, l2_heading, l3_heading, tidy, trim_whitespace};
2323

2424
impl Distribution<HouseDishWhatSide> for StandardUniform {
2525
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> HouseDishWhatSide {
@@ -498,39 +498,46 @@ pub mod list {
498498
}
499499

500500
impl fmt::Display for PBHouse {
501+
501502
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
502-
write!(
503+
writeln!(
503504
f,
504-
l1_heading("Narrative Information")
505+
"{}", l1_heading("Narrative Information".to_string())
505506
)?;
507+
writeln!(f, " ")?;
506508

507-
write!(
509+
writeln!(
508510
f,
509-
l2_heading("For the Characters")
511+
"{}", l2_heading("For the Characters".to_string())
510512
)?;
513+
writeln!(f, " ")?;
511514
for line in &self.general_info() {
512-
write!(f, "{}", line)?;
515+
write!(f, "{}", line)?;
513516
}
514517

515-
write!(
518+
writeln!(
516519
f,
517-
l2_heading("GM Notes")
520+
"{}", l2_heading("GM Notes".to_string())
518521
)?;
519-
write!(
522+
writeln!(f, " ")?;
523+
writeln!(
520524
f,
521-
l3_heading("Establishment History")
525+
"{}", l3_heading("Establishment History".to_string())
522526
)?;
527+
writeln!(f, " ")?;
523528
for line in &self.establishment_history_notes {
524-
write!(f, "{}", line)?;
529+
writeln!(f, "{}", line)?;
525530
}
531+
writeln!(f, " ")?;
526532

527-
write!(
533+
writeln!(
528534
f,
529-
l3_heading("Redlight Services")
530-
)?;
535+
"{}", l3_heading("Redlight Services".to_string())
536+
)?;
531537
for line in &self.redlight_services {
532-
write!(f, "\n{}", line)?;
538+
writeln!(f, "{}", line)?;
533539
}
540+
writeln!(f, " ")?;
534541

535542
Ok(())
536543
}

0 commit comments

Comments
 (0)