Skip to content

Commit

Permalink
add Q&A to index
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Dec 10, 2024
1 parent 3b18608 commit d57447e
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 97 deletions.
114 changes: 114 additions & 0 deletions html/files/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

<html>
<head>
<title>About | Reminder</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0;}
#head { margin-bottom: 2.5em; }
#head a { margin-right: 10px; color: black; font-weight: bold; text-decoration: none; }
#container { height: 100%; max-width: 1024px; margin: 0 auto; padding: 25px;}
#content { padding-bottom: 100px; }
#content p { padding: 0 0 25px 0; margin: 0; }
#search { margin-top: 10px; } #q { padding: 10px; width: 100%; }
@font-face {
font-family: 'arabic';
src: url('/files/arabic.otf') format('opentype');
font-weight: normal;
font-style: normal;
}
.arabic {
font-family: 'arabic';
font-size: 1.5em;
}
.chapter {
margin: 10px;
border: 1px solid grey;
padding: 10px;
display: inline-block;
}
</style>
</head>
<body>
<div id="container">
<div id="head">
<a href="/">[Reminder]</a>
<a href="/about">About</a>
<a href="/quran">Quran</a>
<a href="/names">Names</a>
<a href="/hadith">Hadith</a>
</div>
<div id="search">
<form id="question" action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
</div>
<div id="content">
<h1 id="what-is-the-reminder">What is the Reminder?</h1>

<p>The Reminder refers to the messages and revelations sent by Allah, primarily embodied in the Quran. It serves as guidance, a warning, and a source of reflection for believers and humanity as a whole. It emphasizes the importance of remembering Allah and following His guidance to lead a righteous life.</p>

<h1 id="what-is-the-quran">What is the Quran?</h1>

<p>The Quran is the holy book of Islam, regarded as the word of Allah (God) as revealed to the Prophet Muhammad through the angel Gabriel. It serves as a guide for humanity, containing teachings on faith, morality, law, and guidance for personal conduct. The Quran is written in Arabic and is comprised of 114 chapters (surahs).</p>

<h1 id="what-is-the-hadith">What is the Hadith?</h1>

<p>A Hadith is a record of the sayings, actions, or approvals of the Prophet Muhammad. It serves as a source of guidance for Muslims on matters of faith, law, and moral conduct, complementing the teachings of the Quran.</p>

<h1 id="who-is-allah">Who is Allah?</h1>

<p>Allah is the one and only God in Islam, the Creator of all things, the Most Compassionate and Most Merciful. He is characterized by His unmatched attributes, including being the All-Powerful, All-Knowing, and the Sustainer of the heavens and the earth. Allah is worshipped alone and holds the authority over everything.</p>

<h1 id="who-is-the-prophet-muhammad">Who is the prophet Muhammad</h1>

<p>Prophet Muhammad is the last messenger of Allah in Islam, regarded as the final prophet in a long line of prophets. He was born in Mecca around 570 CE and received divine revelations through the angel Gabriel, which constitute the Quran. He is known for his teachings on monotheism, morality, and social justice, and he established Islam as a major world religion. Muhammad is often referred to as &ldquo;The Apostle of Allah&rdquo; and is characterized by his exemplary moral conduct and compassion.</p>

<h1 id="why-do-we-worship-allah">Why do we &lsquo;worship&rsquo; Allah?</h1>

<p>We worship Allah because He is the Creator of all things, the Sustainer, and the One who deserves our gratitude and devotion. Worshiping Allah acknowledges His greatness, attributes, and commands, as well as our dependence on Him for guidance, mercy, and sustenance. It reflects our faith, submission, and love for Him, fulfilling our purpose as His creation.</p>

<h1 id="how-do-we-worship-allah">How do we &lsquo;worship&rsquo; Allah?</h1>

<p>Worshiping Allah involves sincere devotion, which can be expressed through various acts such as:</p>

<ol>
<li><strong>Prayer</strong>: Performing the five daily prayers with devotion.</li>
<li><strong>Supplication</strong>: Making personal prayers and seeking guidance.</li>
<li><strong>Reading the Quran</strong>: Engaging with the teachings of the Quran.</li>
<li><strong>Charity</strong>: Giving to those in need and performing acts of kindness.</li>
<li><strong>Fasting</strong>: Observing fasts, especially during Ramadan.</li>
<li><strong>Good Deeds</strong>: Leading a life of righteousness, honesty, and compassion.</li>
<li><strong>Gratitude</strong>: Acknowledging and being thankful for Allah&rsquo;s blessings.</li>
<li><strong>Reciting Dhikr</strong>: Remembrance of Allah through phrases of praise.</li>
</ol>

<p>Ultimately, worship is about acknowledging Allah&rsquo;s greatness and striving to live in accordance with His guidance.</p>

<h1 id="what-happens-when-we-die">What happens when we die?</h1>

<p>When a person dies, their soul is taken by the Angel of Death, and they are returned to their Lord for judgment. After death, individuals may be shown their place in the afterlife, whether it is Paradise or Hell, based on their deeds in life. The resurrection will occur on the Day of Judgment, where everyone will be held accountable for their actions.</p>

<h1 id="how-do-i-remember-allah">How do I remember Allah?</h1>

<p>You can remember Allah through regular practices such as:</p>

<ol>
<li><strong>Prayer (Salah):</strong> Establish and maintain your five daily prayers.</li>
<li><strong>Recitation of the Quran:</strong> Read and reflect on the Quran&rsquo;s verses.</li>
<li><strong>Dhikr (Remembrance):</strong> Engage in verbal remembrances such as saying &ldquo;Subhanallah&rdquo; (Glory be to Allah), &ldquo;Alhamdulillah&rdquo; (All praise is for Allah), and &ldquo;Allahu Akbar&rdquo; (Allah is the Greatest).</li>
<li><strong>Gratitude:</strong> Reflect on Allah&rsquo;s favors and express thanks.</li>
<li><strong>Reflection:</strong> Contemplate on the creation and the signs of Allah around you.</li>
<li><strong>Supplication (Dua):</strong> Make personal prayers and seek closeness to Him.</li>
</ol>

<p>Incorporating these practices into your daily routine can help keep you mindful of Allah.</p>

<h1 id="how-do-i-become-muslim">How do I become Muslim?</h1>

<p>To become a Muslim, you need to sincerely declare your faith by reciting the Shahada, which is the testimony of faith: &ldquo;Ashhadu an la ilaha illa Allah, wa ashhadu anna Muhammadur rasul Allah.&rdquo; This means &ldquo;I bear witness that there is no god but Allah, and I bear witness that Muhammad is His messenger.&rdquo; It is recommended to do this in the presence of witnesses, such as in a mosque, but it can be done privately as well.</p>

<p>After declaring your faith, it is important to learn about and practice the key elements of Islam, such as the five pillars: the declaration of faith, prayer, fasting during Ramadan, giving Zakat (charity), and performing Hajj (pilgrimage to Mecca) if able. Engaging with the Muslim community and seeking knowledge will also aid in your spiritual growth.</p>

</div>
</div>
</body>
</html>
3 changes: 2 additions & 1 deletion html/files/hadith.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
<div id="container">
<div id="head">
<a href="/">[Reminder]</a>
<a href="/about">About</a>
<a href="/quran">Quran</a>
<a href="/names">Names</a>
<a href="/hadith">Hadith</a>
</div>
<div id="search">
<form action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
<form id="question" action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
</div>
<div id="content">
<h1 id="volume-1">Volume 1</h1>
Expand Down
116 changes: 29 additions & 87 deletions html/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,100 +33,42 @@
<div id="container">
<div id="head">
<a href="/">[Reminder]</a>
<a href="/about">About</a>
<a href="/quran">Quran</a>
<a href="/names">Names</a>
<a href="/hadith">Hadith</a>
</div>
<div id="search">
<form action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
<form id="question" action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
</div>
<div id="content">
<h1 id="what-is-the-reminder">What is the Reminder?</h1>

<p>The Reminder refers to the messages and revelations from Allah, particularly the Quran, which serve as guidance, warnings, and teachings for humanity. It encourages reflection, mindfulness, and remembrance of Allah&rsquo;s signs and commands.</p>

<h1 id="what-is-the-quran">What is the Quran?</h1>

<p>The Quran is the holy book of Islam, believed to be the word of Allah (God) as revealed to the Prophet Muhammad through the angel Gabriel. It serves as a guide for Muslims in matters of faith, morality, and law, and is written in Arabic. The Quran consists of verses (ayahs) organized into chapters (surahs). It is regarded as a source of spiritual guidance and wisdom for believers.</p>

<h1 id="what-is-the-hadith">What is the Hadith?</h1>

<p>A Hadith is a recorded saying, action, or tacit approval of the Prophet Muhammad. It serves as a source of guidance for Muslims, complementing the teachings of the Quran. Hadiths are critical in shaping Islamic law, ethics, and practices.</p>

<h1 id="who-is-allah">Who is Allah?</h1>

<p>Allah is the One true God, the Creator of all things, characterized as the Most Compassionate, Most Merciful. He is All-Knowing and All-Wise, and there is no god worthy of worship except Him. He sustains and maintains everything in existence and encompasses all knowledge of the seen and unseen.</p>

<h1 id="who-is-the-prophet-muhammad">Who is the prophet Muhammad</h1>

<p>Prophet Muhammad is the last messenger of Allah in Islam, regarded as a model for human behavior and the final prophet in a line that includes figures like Adam, Noah, Abraham, Moses, and Jesus. He was born in Mecca around 570 CE and received revelations from Allah through the angel Gabriel. These revelations are recorded in the Quran, the holy book of Islam. Muhammad is known for his exemplary character, teachings on compassion, justice, and monotheism, and his role in establishing the Muslim community.</p>

<h1 id="why-do-we-worship-allah">Why do we &lsquo;worship&rsquo; Allah?</h1>

<p>We worship Allah because He is the Creator, Sustainer, and Lord of the universe, deserving of our devotion and gratitude. Worshiping Allah fulfills our purpose as humans, strengthens our connection with Him, and cultivates a sense of moral and spiritual guidance in life. It is an expression of our acknowledgment of His greatness, mercy, and authority.</p>

<h1 id="how-do-we-worship-allah">How do we &lsquo;worship&rsquo; Allah?</h1>

<p>Worshiping Allah involves several key practices:</p>

<ol>
<li><p><strong>Sincerity in Devotion</strong>: Being sincerely devoted to Allah alone, without associating any partners with Him.</p></li>

<li><p><strong>Prayer</strong>: Performing the five daily prayers (Salah) as prescribed.</p></li>

<li><p><strong>Supplication</strong>: Engaging in personal prayers and invocations (dua) to seek Allah&rsquo;s guidance and mercy.</p></li>

<li><p><strong>Gratitude</strong>: Expressing gratitude for Allah&rsquo;s blessings and provisions.</p></li>

<li><p><strong>Reading and Reflecting on the Quran</strong>: Understanding and following the teachings of the Quran.</p></li>

<li><p><strong>Performing Good Deeds</strong>: Engaging in charitable acts, helping others, and living a life of integrity and righteousness.</p></li>

<li><p><strong>Remembrance (Dhikr)</strong>: Regularly remembering and glorifying Allah through phrases and invocations.</p></li>

<li><p><strong>Obedience</strong>: Following the commandments and guidance set forth by Allah and His Messenger, Prophet Muhammad (peace be upon him).</p></li>
</ol>

<p>These actions, grounded in faith, help deepen one&rsquo;s connection with Allah.</p>

<h1 id="what-happens-when-we-die">What happens when we die?</h1>

<p>When we die, our souls are taken by the Angel of Death, and we are returned to Allah for judgment. The deceased will either be shown their place in Paradise or Hell, indicating their ultimate fate. On the Day of Resurrection, all will be raised back to life for final judgment based on their deeds.</p>

<h1 id="how-do-i-remember-allah">How do I remember Allah?</h1>

<p>To remember Allah, you can engage in practices such as:</p>

<ol>
<li><strong>Prayers (Salah)</strong>: Establish regular prayers to connect with Allah.</li>
<li><strong>Reciting the Quran</strong>: Read and reflect on the meanings of the Quran regularly.</li>
<li><strong>Dhikr (Remembrance)</strong>: Engage in dhikr by repeating phrases that glorify Allah, such as &ldquo;SubhanAllah&rdquo; (Glory be to Allah), &ldquo;Alhamdulillah&rdquo; (All praise is due to Allah), and &ldquo;Allahu Akbar&rdquo; (Allah is the Greatest).</li>
<li><strong>Gratitude</strong>: Regularly express gratitude for Allah&rsquo;s blessings in your life.</li>
<li><strong>Reflection</strong>: Spend time reflecting on the creation and signs of Allah in the world around you.</li>
<li><strong>Seeking Knowledge</strong>: Learn about Allah, His attributes, and teachings through study and contemplation.</li>
</ol>

<p>Incorporating these practices into your daily routine can help cultivate mindfulness of Allah.</p>

<h1 id="how-do-i-become-muslim">How do I become Muslim?</h1>

<p>To become Muslim, you need to follow these steps:</p>

<ol>
<li><p><strong>Declare the Shahada</strong>: Profess your faith by reciting the Shahada, which is the declaration &ldquo;Ashhadu an la ilaha illallah, wa ashhadu anna Muhammadur Rasulullah.&rdquo; This means &ldquo;I bear witness that there is no god but Allah, and Muhammad is His Messenger.&rdquo;</p></li>

<li><p><strong>Understand the Core Beliefs</strong>: Familiarize yourself with the fundamental beliefs of Islam, including belief in one God (Allah), the Angels, the Prophets, the Holy Books, the Day of Judgment, and Divine Decree.</p></li>

<li><p><strong>Perform Prayer (Salah)</strong>: Begin learning and performing the five daily prayers.</p></li>

<li><p><strong>Embrace the Pillars of Islam</strong>: Besides the Shahada, understand and commit to the other pillars of Islam, which include fasting during Ramadan, giving to charity (Zakat), and making the pilgrimage to Mecca (Hajj) if able.</p></li>

<li><p><strong>Seek Knowledge</strong>: Learn about Islamic teachings, the Quran, and the life of the Prophet Muhammad (peace be upon him).</p></li>

<li><p><strong>Join a Community</strong>: Engage with a local mosque or Muslim community for support and guidance.</p></li>
</ol>

<p>It is a personal journey, and sincerity in your intentions is key.</p>

<div id="answer"></div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var form = document.getElementById("question");
form.addEventListener("submit", function(ev) {
ev.preventDefault();
var q = document.getElementById("q");

var xhr = new XMLHttpRequest();
var url = "/search.json";
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
var json = JSON.parse(xhr.responseText);
var ans = document.getElementById("answer");
var text = "<p><b>Q</b>: " + q.value + "</p><p><b>A</b>: " + json.answer + "</p>";
ans.innerHTML = text + ans.innerHTML;
q.value = '';
}
};
var data = JSON.stringify({"q": q.value});
xhr.send(data);
});
}, false);
</script>

</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion html/files/names.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
<div id="container">
<div id="head">
<a href="/">[Reminder]</a>
<a href="/about">About</a>
<a href="/quran">Quran</a>
<a href="/names">Names</a>
<a href="/hadith">Hadith</a>
</div>
<div id="search">
<form action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
<form id="question" action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
</div>
<div id="content">
<h1 id="1">1</h1>
Expand Down
3 changes: 2 additions & 1 deletion html/files/quran.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
<div id="container">
<div id="head">
<a href="/">[Reminder]</a>
<a href="/about">About</a>
<a href="/quran">Quran</a>
<a href="/names">Names</a>
<a href="/hadith">Hadith</a>
</div>
<div id="search">
<form action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
<form id="question" action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
</div>
<div id="content">
<h1 id="1">1</h1>
Expand Down
36 changes: 35 additions & 1 deletion html/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ var Template = `
<div id="container">
<div id="head">
<a href="/">[Reminder]</a>
<a href="/about">About</a>
<a href="/quran">Quran</a>
<a href="/names">Names</a>
<a href="/hadith">Hadith</a>
</div>
<div id="search">
<form action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
<form id="question" action="/search" method="post"><input id="q" name=q placeholder="Ask a question"></form>
</div>
<div id="content">
%s
Expand All @@ -58,6 +59,35 @@ var Template = `
</html>
`

var Index = `
<div id="answer"></div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var form = document.getElementById("question");
form.addEventListener("submit", function(ev) {
ev.preventDefault();
var q = document.getElementById("q");
var xhr = new XMLHttpRequest();
var url = "/search.json";
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
var json = JSON.parse(xhr.responseText);
var ans = document.getElementById("answer");
var text = "<p><b>Q</b>: " + q.value + "</p><p><b>A</b>: " + json.answer + "</p>";
ans.innerHTML = text + ans.innerHTML;
q.value = '';
}
};
var data = JSON.stringify({"q": q.value});
xhr.send(data);
});
}, false);
</script>
`

func Render(md []byte) []byte {
// create markdown parser with extensions
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
Expand All @@ -72,6 +102,10 @@ func Render(md []byte) []byte {
return markdown.Render(doc, renderer)
}

func RenderHTML(title, html string) string {
return fmt.Sprintf(Template, title, html)
}

func RenderString(v string) string {
return string(Render([]byte(v)))
}
Expand Down
Loading

0 comments on commit d57447e

Please sign in to comment.