Whitepaper
Docs
Sign In
Tool
Tool
website gen
Tool ID
website_gen
Creator
@helvity
Downloads
205+
website gen
Get
README
No README available
Tool Code
Show
from flask import Flask, render_template_string app = Flask(__name__) class Tools: dynamic_routes = {} # Stores created routes and their HTML content @classmethod def add_dynamic_route(cls, route, content): # Ensure the route starts with '/' if not route.startswith('/'): route = '/' + route # Define a dynamic view that renders the provided content. def dynamic_view(): return render_template_string(content) # Create a unique endpoint name from the route. endpoint = route.strip("/").replace("/", "_") or "root" if endpoint in app.view_functions: endpoint += "_dynamic" # Add the route to the Flask app and store it. app.add_url_rule(route, endpoint, dynamic_view) cls.dynamic_routes[route] = content @classmethod def add_route_from_text(cls, text): """ Expects a text block with three lines: Line 1: route (e.g. "profile") Line 2: version (e.g. "jailbreakV2:latest") Line 3: plugin type (e.g. "'type'") """ lines = text.strip().splitlines() if len(lines) < 3: raise ValueError("Input text must have at least three lines: route, version, and plugin_type.") route = lines[0].strip() version = lines[1].strip() plugin_type = lines[2].strip() # Use plugin_type instead of type to avoid conflicts # Create simple HTML content to display the provided data. content = ( f"<h1>{route.capitalize()}</h1>" f"<p><strong>Version:</strong> {version}</p>" f"<p><strong>Type:</strong> {plugin_type}</p>" ) # Add the dynamic route using the given route and generated content. cls.add_dynamic_route(route, content) # Example usage (uncomment the following lines to test the plugin): # text_input = """profile # jailbreakV2:latest # 'type'""" # # Tools.add_route_from_text(text_input) # # if __name__ == '__main__': # app.run(debug=True)