This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
300 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Contributing to Smart Manager</title> | ||
<link rel="stylesheet" href="../stylesheets/style.css"> | ||
<link rel="stylesheet" href="../prism/prism.css"> | ||
<script src="../prism/prism.js"></script> | ||
</head> | ||
|
||
<body style="font-size: 1.1em;"> | ||
<header> | ||
<h1>Smart Manager</h1> | ||
<nav> | ||
<a href="../index.html">Home</a> | ||
<a href="../download.html">Download</a> | ||
</nav> | ||
</header> | ||
|
||
<h1>Contributing to Smart Manager</h1> | ||
|
||
<section> | ||
<p>Welcome to the Smart Manager project! We greatly value your interest in contributing to this endeavor.</p> | ||
|
||
<h2>How to Contribute</h2> | ||
|
||
<ol> | ||
<li><strong>Fork the Repository:</strong> Begin by clicking the "Fork" button located in the upper right corner of the repository's page. This action creates a duplicate of the repository within your GitHub account.</li> | ||
|
||
<li><strong>Clone Your Fork:</strong> Clone the forked repository to your local machine. Replace <code>YourUsername</code> with your GitHub username: | ||
<pre class="lang-bash"><code>git clone https://github.com/YourUsername/Smart_Manager.git</code></pre> | ||
</li> | ||
|
||
<li><strong>Create a New Branch:</strong> Create a new branch for your contributions: | ||
<pre class="lang-bash"><code>git checkout -b feature/your-feature-name</code></pre> | ||
</li> | ||
|
||
<li><strong>Make your changes:</strong> Implement your feature or fix.</li> | ||
|
||
<li><strong>Test Your Changes:</strong> Ensure that your modifications do not disrupt current functionality. If applicable, add pertinent tests to cover your changes.</li> | ||
|
||
<li><strong>Commit Your Changes:</strong> Commit your changes along with a descriptive message: | ||
<pre class="lang-bash"><code>git commit -m 'Add your feature'</code></pre> | ||
</li> | ||
|
||
<li><strong>Push to Your Branch:</strong> Push your changes to your GitHub repository: | ||
<pre class="lang-bash"><code>git push origin feature/your-feature-name</code></pre> | ||
</li> | ||
|
||
<li><strong>Submit a Pull Request:</strong> On the GitHub page of your fork, create a pull request. Provide comprehensive details about your changes and proceed to submit the pull request.</li> | ||
</ol> | ||
|
||
<h2>Reporting Issues</h2> | ||
|
||
<p>If you come across any issues or have suggestions for improvement, kindly <a href="https://github.com/JeelDobariya38/Smart-Manager/issues">create an issue</a> on GitHub. Ensure to provide meticulous information about the problem and steps to reproduce it.</p> | ||
|
||
<h2>Code Style</h2> | ||
|
||
<p>Maintain consistency with the code style employed in the project, including uniform indentation and formatting. When in doubt, refer to the existing codebase for guidance.</p> | ||
|
||
<h2>Code of Conduct</h2> | ||
|
||
<p>Please be mindful that this project adheres to a <a href="CODE_OF_CONDUCT.md">Code of Conduct</a>. By participating, you agree to uphold these principles.</p> | ||
|
||
<h2>Running the Smart Manager App Locally</h2> | ||
|
||
<p>To run the Smart Manager app on your local environment, employ the provided Python script. Ensure Python is installed and that you are in the repository's root directory, then execute:</p> | ||
|
||
<pre class="lang-py"><code>python src/main.py</code></pre> | ||
|
||
<h2>Contributing Code</h2> | ||
|
||
<p>For code contributions, adhere to the coding conventions and encompass relevant tests.</p> | ||
|
||
<h3>Example Code</h3> | ||
|
||
<p>Here is an example Python script. Feel free to provide your feedback or contribute to enhance the repository's style:</p> | ||
|
||
<pre class="lang-py"><code>def greet(name: str) -> None: | ||
message = f"Hello, {name}!" | ||
print(message) | ||
|
||
def calculate_sum(a: int | float, b: int | float) -> int | float: | ||
result = a + b | ||
return result | ||
|
||
if __name__ == "__main__": | ||
user_name = input("Enter your name: ") | ||
greet(user_name) | ||
|
||
num1 = float(input("Enter the first number: ")) | ||
num2 = float(input("Enter the second number: ")) | ||
|
||
total = calculate_sum(num1, num2) | ||
print(f"The sum is: {total}") | ||
</code></pre> | ||
|
||
<p><strong>Notable Code Elements for Reference</strong></p> | ||
|
||
<ol> | ||
<li><strong>Indentation:</strong> Consistently use 4 spaces for indentation, a widely accepted convention in Python, to maintain uniformity.</li> | ||
<li><strong>Whitespace:</strong> Ensure consistency in spacing around operators and after commas, as observed in the existing codebase.</li> | ||
<li><strong>Imports:</strong> Organize imports and follow the standard Python style. Group third-party imports at the top, preceded by a blank line, followed by built-in module imports.</li> | ||
<li><strong>Function and Method Naming:</strong> Keep function and method names in lowercase with words separated by underscores (<code>snake_case</code>), in adherence to Python's recommended convention.</li> | ||
<li><strong>Use of Type Hints:</strong> Continue using type hints for function arguments and return types to enhance code clarity and maintain readability.</li> | ||
</ol> | ||
|
||
<p>Remember, these guidelines are flexible, with the primary emphasis on maintaining consistency within the codebase.</p> | ||
|
||
<h2>Feature Suggestions</h2> | ||
|
||
<p>Should you possess ideas for new features or improvements, we encourage you to discuss them in the <a href="https://github.com/JeelDobariya38/Smart-Manager/discussions">GitHub Discussions</a> section.</p> | ||
|
||
<p>Thank you for your valuable contributions to Smart Manager!</p> | ||
</section> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Jeel Dobariya | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function addWbrToLinks() { | ||
// Get all elements with anchor tags | ||
var links = document.getElementsByTagName('a'); | ||
|
||
// Loop through each anchor tag | ||
for (var i = 0; i < links.length; i++) { | ||
var link = links[i]; | ||
|
||
// Get the original link | ||
var originalLink = link.innerHTML; | ||
|
||
// Split the link by "/" | ||
var parts = originalLink.split('/'); | ||
|
||
// Create a new link with <wbr> after each "/" | ||
var newLink = parts.join('/<wbr>'); | ||
|
||
// Set the innerHTML of the anchor tag to the new link | ||
link.innerHTML = newLink; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* requires <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/2.0.3/marked.min.js"></script> */ | ||
/* requires <script src="{root-of-repo}/docs/scripts/linkbreaker.js"></script> */ | ||
// Note: Below code assume that the asset for windows attach to release will have nameing patten as `smart-manager.${release.tag}.${platform}.zip` | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
// Ensure marked.js is loaded | ||
if (typeof marked === 'undefined') { | ||
console.error("marked.js is not loaded"); | ||
return; | ||
} | ||
|
||
fetch("https://api.github.com/repos/JeelDobariya38/Smart-Manager/releases") | ||
.then(response => response.json()) | ||
.then(releases => { | ||
console.log(releases); | ||
|
||
// Find the "Other Releases" container | ||
const otherReleasesContainer = document.querySelector('.other-version'); | ||
console.log(otherReleasesContainer) | ||
|
||
for (var release of releases) { | ||
if (!release.draft) { | ||
var convertedBody = marked(release.body); // <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/2.0.3/marked.min.js"></script> | ||
var pythondownloadlink = '#'; | ||
var windowsdownloadlink = '#'; | ||
for (var asset of release.assets) { | ||
if (asset.name.endsWith(".zip")) { | ||
if (asset.name.endsWith("python.zip")) { | ||
pythondownloadlink = asset.browser_download_url; | ||
} | ||
if (asset.name.endsWith("windows.zip")) { | ||
windowsdownloadlink = asset.browser_download_url; | ||
} | ||
} | ||
} | ||
var releaseElement = document.createElement('div'); | ||
releaseElement.classList.add('release'); | ||
releaseElement.innerHTML = ` | ||
<h1>${release.name}</h1> | ||
<div class="info"> | ||
<div><b>Prerelease: <span class="prerelease">${release.prerelease}</span></b></div> | ||
<div><b>Published At: <span class="published-at">${release.published_at}</span></b></div> | ||
</div> | ||
<div class="notes">${convertedBody}</div> | ||
<a href="${pythondownloadlink}" target="_blank"><button class="downloadbtn"> Python Download</button></a> | ||
<a href="${windowsdownloadlink}" target="_blank"><button class="downloadbtn">Windows Download</button></a> | ||
`; | ||
otherReleasesContainer.appendChild(releaseElement); | ||
} | ||
} | ||
|
||
// Check if there are no other releases and display an error message | ||
if (otherReleasesContainer.children.length === 0) { | ||
const errorMsg = document.querySelector('.other-version .error-msg'); | ||
errorMsg.style.display = 'block'; | ||
} | ||
|
||
addWbrToLinks(); // <script src="{root-of-repo}/docs/scripts/linkbreaker.js"></script> | ||
}) | ||
.catch(error => console.error("Error fetching latest release:", error)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters