Smart docs template - make part of custom drupal module

Not applicable

I was referring this URL : https://community.apigee.com/articles/49980/smartdocs-alternative-to-swagger-ui-great-features.html

below point

Smartdocs Template is cluttered !!

  • CSS, JS, HTML all in one place in single text area. It sucks. Can't modify anything.
  • What can be done ? Provide option to manage same in file system inside a custom module or theme.

I saw one post where we are uploading .hbr file from UI. I would like this to be part of code wither in module or template . How this can be achievable ?

Solved Solved
2 1 358
1 ACCEPTED SOLUTION

Not applicable

I was trying couple of options but this option suites me( Avoided doing configurations from UI/streamline with CI/CD)

1)Create a module, link for reference

https://community.apigee.com/articles/27169/apigee-developer-portal-custom-smartdocs-template.html

a) From above mentioned sample module take out smartdocs_custom.hbr file, as you can not refer smartdocs_custom.hbr from inside the module

b) Remove all css code from the template smartdocs_custom.hbr (use css file present in the module)

2) write a hook_update

a) Save smartdocs_custom.hbr in to the public folder and make an entry in the file_managed table in the db use file_save_data api

b) write a set variable code to refer file path from UI

hope this helps

srinil




View solution in original post

1 REPLY 1

Not applicable

I was trying couple of options but this option suites me( Avoided doing configurations from UI/streamline with CI/CD)

1)Create a module, link for reference

https://community.apigee.com/articles/27169/apigee-developer-portal-custom-smartdocs-template.html

a) From above mentioned sample module take out smartdocs_custom.hbr file, as you can not refer smartdocs_custom.hbr from inside the module

b) Remove all css code from the template smartdocs_custom.hbr (use css file present in the module)

2) write a hook_update

a) Save smartdocs_custom.hbr in to the public folder and make an entry in the file_managed table in the db use file_save_data api

b) write a set variable code to refer file path from UI

hope this helps

srinil