Skip to content

Commit

Permalink
Merge pull request #955 from roboflow/block-gallery-refactor
Browse files Browse the repository at this point in the history
Block gallery refactor
  • Loading branch information
grzegorz-roboflow authored Jan 24, 2025
2 parents 61aab85 + 9a5b45b commit cf7d4bb
Show file tree
Hide file tree
Showing 10 changed files with 354 additions and 132 deletions.
369 changes: 239 additions & 130 deletions development/docs/build_block_docs.py

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions development/docs/templates/blocks_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
hide:
- toc
---
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.8/purify.min.js"></script>
<link rel="stylesheet" href="/styles/workflows.css">

<script src="https://kit.fontawesome.com/c9c3956d39.js" crossorigin="anonymous"></script>


<section class="mdx-container portfolio-section">
<div class="md-grid md-typeset">
<div class="text-center">
<h1>Workflow Blocks</h1>
</div>

{% for section in block_sections %}
<div class="section">
<h2>{{ section.title | capitalize }}</h2>
<div class="blocks">
<div class="custom-grid">
{% for block in blocks_by_section[section.id] %}



<a href="{{block.url}}">
<div class="block">
<div class="block_name"> <i class="{{block.icon}}" > </i> {{ block.name }}</div>
<div class="block_description">{{ block.description }}</div>
<!-- <div class="block_license">{{ block.license }}</div> -->
</div>
</a>


{% endfor %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</section>

<style>
/* hide edit button for generated pages */
article > a.md-content__button.md-icon:first-child {
display: none;
}

.block {
border: 1px solid black;
border-radius: 4px;
padding: 10px;
height: 100px;
}

.block_name {
font-size: large;
color: black;
}

.block_description {
font-size: 0.65em;
padding-top: 5px;
color: #444;
}

.block_license {
background-color: #14b8a6;
color: #fff;
padding: 2px 4px;
border-radius: 4px;
font-size: small;
}


</style>
4 changes: 4 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
hide:
- toc
---
When the Inference Server is running, it provides OpenAPI documentation at the `/docs` endpoint for use in development.

Below is the OpenAPI specification for the Inference Server for the current release version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class DominantColorManifest(WorkflowBlockManifest):
"long_description": LONG_DESCRIPTION,
"license": "Apache-2.0",
"block_type": "classical_computer_vision",
"ui_manifest": {
"section": "classical_cv",
"icon": "far fa-palette",
"blockPriority": 1,
"opencv": True,
},
}
)
image: Selector(kind=[IMAGE_KIND]) = Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class ImageBlurManifest(WorkflowBlockManifest):
"long_description": LONG_DESCRIPTION,
"license": "Apache-2.0",
"block_type": "classical_computer_vision",
"ui_manifest": {
"section": "classical_cv",
"icon": "far fa-droplet",
"blockPriority": 5,
"opencv": True,
},
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ class BlockManifest(WorkflowBlockManifest):
"long_description": LONG_DESCRIPTION,
"license": "Apache-2.0",
"block_type": "model",
"ui_manifest": {
"section": "model",
"icon": "far fa-text",
"blockPriority": 11,
"inDevelopment": True,
"inference": True,
},
}
)
type: Literal["roboflow_core/ocr_model@v1", "OCRModel"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class BlockManifest(WorkflowBlockManifest):
"license": "Apache-2.0",
"block_type": "sink",
"ui_manifest": {
"section": "model",
"section": "notifications",
"icon": "far fa-envelope",
"blockPriority": 0,
"popular": True,
Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/core_steps/sinks/local_file/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class BlockManifest(WorkflowBlockManifest):
"license": "Apache-2.0",
"block_type": "sink",
"ui_manifest": {
"section": "model",
"section": "data_storage",
"icon": "fal fa-file",
"blockPriority": 3,
"popular": True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class BlockManifest(WorkflowBlockManifest):
"long_description": LONG_DESCRIPTION,
"license": "Apache-2.0",
"block_type": "transformation",
"ui_manifest": {
"section": "transformation",
"icon": "far fa-crop-alt",
"blockPriority": 1,
},
}
)
type: Literal["roboflow_core/absolute_static_crop@v1", "AbsoluteStaticCrop"]
Expand Down
6 changes: 6 additions & 0 deletions inference/core/workflows/core_steps/visualizations/dot/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ class DotManifest(ColorableVisualizationManifest):
"long_description": LONG_DESCRIPTION,
"license": "Apache-2.0",
"block_type": "visualization",
"ui_manifest": {
"section": "classical_cv",
"icon": "far fa-palette",
"blockPriority": 1,
"opencv": True,
},
}
)

Expand Down

0 comments on commit cf7d4bb

Please sign in to comment.