Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
updating feature (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeelDobariya38 authored Nov 29, 2023
2 parents bf7a108 + 43d7aac commit e6752fe
Show file tree
Hide file tree
Showing 8 changed files with 300 additions and 12 deletions.
28 changes: 24 additions & 4 deletions docs/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Smart Manager | Download</title>
<link rel="stylesheet" href="stylesheets/style.css">
<script src="scripts/linkbreaker.js"></script>
<script src="scripts/download.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/2.0.3/marked.min.js"></script>
<script src="scripts/otherversion.js"></script>
</head>
<body>
<header>
Expand All @@ -16,10 +20,10 @@ <h1>Download Page Of Smart Manager</h1>
</header>

<section>
<p>Welcome to the download page for Smart Manager. Select your platform and click the button below to download the latest release.</p>
<p>For specific release or version, visit your GitHub repository's <a href="https://github.com/JeelDobariya38/smart-manager/releases">release page</a></p>
<h1>Latest Releases</h1>
<h4>Welcome to the download page for Smart Manager. Select your platform and click the button below to download the latest release.</h4>

<label for="platformDropdown">Select Your Platform:</label>
<label for="platformDropdown"><b>Select Your Platform:</b></label>
<br>
<select id="platformDropdown" defaultValue="python">
<option value="python">Python</option>
Expand All @@ -35,7 +39,23 @@ <h1>Download Page Of Smart Manager</h1>

<p><strong>Recommendation:</strong> We strongly recommend downloading the Python version, especially if you are familiar with Python. This ensures a smoother experience and avoids any false positive warnings. Simply select the "Python" option from the dropdown.</p>
</section>


<script src="scripts/download.js"></script>
<section>
<div class="other-version content">
<h1>Other Releases</h1>
<!-- <div class="release">
<h1>vX.X.X-type</h1>
<div class="info">
<div>Prerelease: <span class="prerelease"></span></div>
<div>Published At: <span class="prerelease"></span></div>
</div>
<p>
baba..baba..baba...
</p>
<a href="#"><button>Download</button></a>
</div> -->
</div>
</section>
</body>
</html>
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,19 @@ <h2>Documentation</h2>

<section>
<h2>Contributing</h2>
<p>We welcome contributions from the open-source community. If you'd like to contribute to Smart Manager's development, please follow our <a href="../CONTRIBUTING.md">contribution guidelines</a>.</p>
<p>We welcome contributions from the open-source community. If you'd like to contribute to Smart Manager's development, please follow our <a href="metadata_copies/CONTRIBUTING.html">contribution guidelines</a>.</p>
</section>

<section>
<h2>License</h2>
<p>This project is licensed under the <a href="../LICENSE.txt">MIT License</a>.</p>
<p>This project is licensed under the <a href="metadata_copies/LICENSE.txt">MIT License</a>.</p>
</section>

<section>
<h2>Contact</h2>
<p>If you have any questions, suggestions, or issues, please feel free to reach out to our development team:</p>
<ul>
<li>Email: <a href="mailto:contact@smartmanagerapp">contact@smartmanagerapp</a></li>
<li>Email: <a href="mailto:dobariyaj34@gmail.com">contact@smartmanagerapp</a></li>
<li>Issue Tracker: <a href="https://github.com/JeelDobariya38/smart-manager/issues">GitHub Issues</a></li>
</ul>
</section>
Expand Down
120 changes: 120 additions & 0 deletions docs/metadata_copies/CONTRIBUTING.html
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>
21 changes: 21 additions & 0 deletions docs/metadata_copies/LICENSE.txt
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.
9 changes: 5 additions & 4 deletions docs/scripts/download.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Note: Below code assume that the asset for windows attach to release will have nameing patten as `smart-manager.${release.tag}.zip`
// Note: Below code assume that the asset for windows attach to release will have nameing patten as `smart-manager.${release.tag}.${platform}.zip`.

const apiEndpoint = 'https://api.github.com/repos/JeelDobariya38/smart-manager/releases/latest';

Expand All @@ -18,8 +18,6 @@ function is_on_windows() {
return platformDropdown.value === 'windows';
}

const downloadButton = document.getElementById('downloadButton');

async function fetchLatestRelease() {
try {
const response = await fetch(apiEndpoint);
Expand Down Expand Up @@ -54,4 +52,7 @@ function getSourceCodeDownloadURL(assets, version) {
return path;
}

downloadButton.addEventListener('click', fetchLatestRelease);
document.addEventListener("DOMContentLoaded" , function() {
const downloadButton = document.getElementById('downloadButton');
downloadButton.addEventListener('click', fetchLatestRelease);
});
21 changes: 21 additions & 0 deletions docs/scripts/linkbreaker.js
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;
}
}
61 changes: 61 additions & 0 deletions docs/scripts/otherversion.js
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));
});
46 changes: 45 additions & 1 deletion docs/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,51 @@ section {
}

#platformDropdown, #downloadButton {
background-color: var(--secondary-text-color);
background-color: pink;
}

#downloadButton {
border-radius: 10px;
border: 0px;
}

::selection {
background-color: pink;
}

#platformDropdown option:checked {
background-color: #2d728f;
color: pink;
}

.release {
color: white;
background-color: #211e1e;
padding: 5px 10px;
border: 6px solid #000;
border-radius: 20px;
margin: 10px 0px;
}

.release .info {
display: flex;
flex-wrap: wrap;
}

.release .info div {
margin: 5px;
}

.release a {
color: rgb(36, 118, 185);
margin: 0px;
text-decoration: dashed;
}

.downloadbtn {
background-color: rgb(36, 118, 185);
border-radius: 12px;
border: 0px;
}

@media (max-width: 296px) {
Expand Down

0 comments on commit e6752fe

Please sign in to comment.