{"id":17787125,"url":"https://github.com/mgrojo/asnip","last_synced_at":"2025-07-29T02:06:30.113Z","repository":{"id":102339022,"uuid":"352452676","full_name":"mgrojo/ASnip","owner":"mgrojo","description":"ASnip reads snippets of Ada source text, correct or incorrect, and produces output suitable for printing, viewing, or including.","archived":false,"fork":false,"pushed_at":"2022-12-31T18:51:08.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-27T15:10:14.494Z","etag":null,"topics":["ada","snippet","wikibooks"],"latest_commit_sha":null,"homepage":"https://en.wikibooks.org/wiki/User:GorgeUbuasha","language":"PLSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgrojo.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-28T22:27:14.000Z","updated_at":"2022-12-31T18:22:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd156d0d-4acd-4027-8aeb-b8f14ac4e4ee","html_url":"https://github.com/mgrojo/ASnip","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"4f0ccf6618eb857fe2a55b9007f4b1cf15723931"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mgrojo/ASnip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrojo%2FASnip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrojo%2FASnip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrojo%2FASnip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrojo%2FASnip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgrojo","download_url":"https://codeload.github.com/mgrojo/ASnip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrojo%2FASnip/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267617643,"owners_count":24116208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ada","snippet","wikibooks"],"created_at":"2024-10-27T10:09:28.309Z","updated_at":"2025-07-29T02:06:30.094Z","avatar_url":"https://github.com/mgrojo.png","language":"PLSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"This file explains building ASnip. ASnip decorates source code with\nmarkup. See doc/asnip.html for how to use it. The license text is in\nfile \"forum.txt\".\n\n:    WHAT\n:    BINARY DISTRIBUTION\n:    BUILDING\n:      Requirements\n:      Documentation\n:      Using ObjectAda\n:      Using GNAT\n:      Using AppletMagic\n:      Using an Ada 95 compiler\n:    INSTALLATION\n:    MISCELLANEOUS NOTES\n\n* WHAT\n\nASnip reads snippets of Ada source text, correct or incorrect, and\nproduces output suitable for printing, viewing, or including.\n\n   * HTML     - use your own style sheets, or the ones provided\n   * Text     - for regression testing, really\n   * TeX      - via Knuth's WEB macros (Try lgrind with LaTeX)\n   * WiKiBook - adds markup used for the Ada Wikibook,\n                automatically links tokens to the Ada reference\n   * (RTF      - time permitting)\n   * (XML      - time permitting, using Simon Wright's ASIS based GIs.)\n\nThe asnip program operates on a stream of characters, so you can use it\nas an external tool with a number of text editors, in scripts, etc. It\ntries to read the character encoding from the environment, but you can\nalso specify one, per run.\n\nAdding or changing output formats is fairly easy. There is a small\nsection in the manual about this.\n\n\n* BINARY DISTRIBUTION\n\nThe binary distribution is a ZIP archive of a Windows executable,\ndocumentation files including this one, and licensing information. Copy\nthe executable to some directory listed in your the program search path.\nThe file \"asnip.html\" contains the manual as a hypertext. It has links\nto more files from the distribution archive.\n\n\n* BUILDING\n\n** Requirements\n\nASnip needs a container package from Ada.Containers or from an Ada 95\nedition of the reference implementation, Indefinite_Vectors.\n\nGNU make or nmake will make things easier. Building does not strictly\ndepend on make programs as their main task is setting things up for Ada\nbuild tools.\n\nIf you want to produce the documentation the same way as I did,\nyou will need xmlto.\n\n\n** Documentation\n\nThe manual page is doc/asnip.html or doc/asnip.l. The text links\nto some prebuild examples, and their sources, which provide further\nexplanation.\n\n(The manual page is made from asnip.xml. Running \"make doc\" will produce\nthe HTML and a Unix man page, both in the \"doc\" subdirectory. (You need\nxmlto.)The Makefile in the doc subdirectory is used for making the\ndifferent example output files. It requires some more tools, namely TeX\nand an XSL transformer (tested with GNU/Linux only).\n\n\n** Using ObjectAda\n\n*** From the Windows command line\n\nThere is an Nmake Makefile.OA for initial setup and building. (It uses\nonly traditional features, so hopefully other make programs can use it\nas well.) Adjust a few variables (macros) at the start of the make file,\nto reflect your installation. Then run\n\nThis is what should happen:\n\nFirst, creates a library for the Ada 95 version of Ada.Containers. For\nexample, assuming the container sources reside in X:\\Containers, changes\nto a fresh directory, Y:\\Containers\\ProjectDir. Runs\n\n#+BEGIN_EXAMPLE\n\tadaopts -sd X:\\Containers\n\tadacomp -O2 -sr X:\\Containers\\a-coinve.adb\n\tadamake -O2 -sr X:\\Containers\\a-coinve.adb\n#+END_EXAMPLE\n\nAdds this library to ASnip's library search path. ASnip also needs the\nPOSIX function getenv(2), and SetEnvironmentVariableA or setenv(2),\nresp.. Assuming ObjectAda is installed in directory O:\\opt\\ObjectAda,\n\n#+BEGIN_EXAMPLE\n\tadaopts -p Y:\\Containers\\ProjectDir\n\tadaopts -lp O:\\opt\\ObjectAda\\apilib\n#+END_EXAMPLE\n\nAssuming the ASnip source files are in S:\\ASnip, and a Win32 version is\nto be built,\n\n#+BEGIN_EXAMPLE\n\tadareg S:\\ASnip\\*.spc S:\\ASnip\\*.bdy S:\\ASnip\\*.ada\n\tadareg S:\\ASnip\\Win32\\*.spc S:\\ASnip\\Win32\\*.bdy\n#+END_EXAMPLE\n\nFinally,\n\n#+BEGIN_EXAMPLE\n\tadabuild ASnip.main\n#+END_EXAMPLE\n\nIf you want to run some tests, add units from the \"test\" subdirectory,\nand build them.\n\n\n*** Using the (traditional) ObjectAda IDE\n\nFirst, make a library from the Ada 95 version of Ada.Containers. In\nparticular, the indefinite vectors package, and its dependences must\nbe compiled. Once you have the library, you can create a project for\nASnip. Add the Ada files from the top level distribution directory\nand, optionally, from the \"test\" subdirectory, plus the Ada files from\nthe UNIX or Win32 directories, whichever fits best. Add the containers\nlibrary to the search path, and add a link path for getenv(2), which\nshould be .\\apilib in the ObjectAda installation directory. The Build\nmenu will then show up to three main units. ASnip.main is the one to\nbecome the \"asnip\" program.\n\n\n** Using GNAT\n\nYou will need a fairly recent GNAT, or follow the generic instructions\nbelow. GNAT GPL Edition 2005, GCC 4.0.x, or GCC 4.1.0 (more or less, see\nGCC Bug #27225) work. For building on Unix-like systems, adjust a few\nsettings in the Makefile. The program configure.sh will help doing this.\nThus\n\n#+BEGIN_EXAMPLE\n$ sh configure\n$ make\n$ make doc\n$ make test # optional\n#+END_EXAMPLE\n\nMake needs to be run only once if you just want to build an asnip\nexecutable. It needs to be re-run if you change files that have more than\none unit in them. (The author runs it routinely, though.) The Makefile\neventually calls gnatmake with a GNAT project file, \"asnip.gpr\". Two\nexternal variables influence the configuration, \"OS\", and \"FLAVOR\". See\nthe comments in the project file.\n\n\n\n** Using AppletMagic\n\nSetup is very similar to ObjectAda setup. ASnip's I/O is implemented\ndifferently, though, and different containers are used. TBD\n\n\n\n** Using an Ada 95 compiler\n\nThe sources are plain Ada 95, provided you can use an Ada 95 version\nof Ada 2005's indefinite vectors container package, or a replacement.\nAdd the needed container units into the library. For building the\nasnip executable, it should be sufficient to add all source files from\nthe top distribution directory to the library, and a suitable choice\nof bodies from the Win32 or UNIX subdirectory. (With Janus/Ada, I/O\nmight be speedier if you prepare bodies of `standard_input_stream` and\n`standard_output_stream` using Stream_IO with STI: and STO:, similar\nto how it is done in the UNIX version. The author hasn't tried this,\nthough. See MISCELLANEOUS NOTES below.) ASnip's main unit, ASnip.main,\nresides in the file \"asnip-main.ada\".\n\nFiles in the \"test\" directory are for testing parts of the program.\nThere are two more main units, contained in the files \"driver.ada\",\nand \"test_binsearch.ada\", respectively.\n\n\n\n* INSTALLATION\n\nThe executable will be found where your tools place it. For GNAT\nthis will be the ./obj directory as requested in the project file. For\nObjectAda, it will be in the project directory. In any case, you may\nwant to copy the executable to a directory in your program search\npath, using the name \"asnip\", or \"asnip.exe\", depending on the operating\nsystem's conventions.\n\n\"make doc\" creates both an HTML file and a UNIX man page. They\nare also part of the distribution, in directory \"doc\".\n\n\n* MISCELLANEOUS NOTES\n\nJanus/Ada on Windows:\nUsenet article \u003cILmdnWHx29q5VMrZnZ2dnUVZ_sednZ2d@megapath.net\u003e,\n2006-05-02, has some tips for writing the `standard_input_stream` and\n`standard_output_stream` functions taking advantage of Janus/Ada's\nSTI: and STO: standard file names. IIUC, you could try them in\na way similar to the UNIX implementations that use Stream_IO instead\nof Text_Streams.\n\nSpeed:\nIn this release, ASnip relies on standard Ada streams reading and\nwriting characters (or bytes), one at a time. This is slow.\n\n--\n$ProjectDate: Tue, 23 May 2006 12:50:14 +0200 $\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgrojo%2Fasnip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgrojo%2Fasnip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgrojo%2Fasnip/lists"}