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

Add flexible formatting options for Audio and Quote display #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Majoramari
Copy link

No description provided.

@MKSherbini
Copy link
Owner

@Majoramari Thank you for contributing. We can change the default behavior, but for the callout fix, a single extra space between them will suffice.

Can you make this change so I can accept the PR?

@Majoramari
Copy link
Author

a single extra space between them will suffice.

Could you clarify the exact location where I should add the extra space?

@MKSherbini
Copy link
Owner

Between the audio element and the Quote.

above this line

> [!Quote] ${this.getSurahTitle(arabicResponse)} - [[${arabicResponse.number}:${arabicResponse.ayahs![0].numberInSurah}](https://surahquran.com/english.php?sora=${arabicResponse.number}&aya=${arabicResponse.ayahs![0].numberInSurah})]

@Majoramari
Copy link
Author

above this line

In the commit 97f8bf7, I swapped the audio and quote, so now the audio comes after the quote to be more UX-friendly when there’s nothing above !Quote.

And this is the result:
image

Refrence code:

	private async fetchQuran(surah: number, ayah: number) {
		const [arabicResponse, translationResponse] = await Promise.all([
			this.fetchData(surah, this.plugin.settings.reciter, ayah),
			this.fetchData(surah, this.plugin.settings.translationOption, ayah)
		]);

		return `> [!Quote] ${this.getSurahTitle(arabicResponse)} - [[${arabicResponse.number}:${arabicResponse.ayahs![0].numberInSurah}](https://surahquran.com/english.php?sora=${arabicResponse.number}&aya=${arabicResponse.ayahs![0].numberInSurah})]
> 
> ${arabicResponse.ayahs![0].text}${this.getTranslation(translationResponse)}

<audio src="${arabicResponse.ayahs![0].audio}" controls>
<p> Audio tag not supported </p>
</audio>
`;
	}

If you still want to add an empty line to get this result:
image

I can add &nbsp; between Quote and Audio

@MKSherbini
Copy link
Owner

UX is subjective, I'd say it's better to be up.

But it's fine, just make it configurable in settings and also increase the version to make it a valid release update.

@Majoramari Majoramari force-pushed the master branch 2 times, most recently from 5966004 to ec3b973 Compare January 4, 2025 19:49
@Majoramari
Copy link
Author

just make it configurable in settings and also increase the version to make it a valid release update.

No problem, I add 2 new settings:
image


✅ Audio Above Quote
❌ Space
image

✅ Audio Above Quote
✅ Space
image

✅ Quote Above Audio
❌ Space
image

✅ Quote Above Audio
✅ Space
image

@Majoramari Majoramari force-pushed the master branch 2 times, most recently from c9422d5 to e5720dd Compare January 4, 2025 20:04
@Majoramari Majoramari changed the title Fix broken callout & Change hadith default behavier Add flexible formatting options for Audio and Quote display Jan 4, 2025
…o position

- Added settings to let users choose whether the Quran quote appears
above or below the audio element.
- Enabled option to toggle an empty line between the Quran quote and the
audio element.
- Fixed previously broken callout formatting.
- Updated version to 0.0.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants